Click here to Skip to main content
15,885,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
private static void menu () {
(the error is here at the private static void menu I have it marked with red )

Error: illegal start of expression




Java
public static void main(String[] args) {
// TODO code application logic here

students.put(((long)101010), new HomeStudent("Pisty","Bolt","Oradea","07568478685","mintias@Roehampton.ac.uk",new Date(),-2000,Course.Computing,101010));
students.put(((long)101011), new InternationalStudent("Andreea","Orescu","New York","07654734567","ariesu@Roehampton.ac.uk",new Date(),-5000,Course.Accounting,101011));
students.put(((long)101012), new InternationalStudent("Raluca","Dumitras","New Orlens","07345286427","ralu78@Roehampton.ac.uk",new Date(),-5000,Course.Business,101012));
students.put(((long)101013), new HomeStudent("Filimon","Razvan","Cluj-Napoca","07597153479","filian@Roehampton.ac.uk",new Date(),-2000,Course.Accounting,101013));

menu () ;
private static void menu () {



System.out.println("***********************");
System.out.println(" * Bright Future *");
System.out.println("***********************");
System.out.println("1.Enroll");
System.out.println("2.Pay Fees");
System.out.println("3.List of Students on Course");
System.out.println("4.Change Course");
System.out.println("5.View Students Profile");
System.out.println("Remove Student From A Course");
System.out.println("\t **** Management Reporting ****");
System.out.println("\t Exit");
System.out.print("Enter Option:");
byte option = input.nextByte(); input.nextLine();


What I have tried:

I tried all of the sources that I could find on the internet it seems that I cannot get it
Posted
Updated 12-Aug-18 22:51pm
v4
Comments
Patrice T 12-Aug-18 13:19pm    
And you plan to tell what is the error message?
Member 13946636 13-Aug-18 4:29am    
It says illegal start of expression
Patrice T 13-Aug-18 4:37am    
What is the code before this ?
Member 13946636 13-Aug-18 4:38am    
public static void main(String[] args) {
// TODO code application logic here

students.put(((long)101010), new HomeStudent("Pisty","Bolt","Oradea","07568478685","mintias@Roehampton.ac.uk",new Date(),-2000,Course.Computing,101010));
students.put(((long)101011), new InternationalStudent("Andreea","Orescu","New York","07654734567","ariesu@Roehampton.ac.uk",new Date(),-5000,Course.Accounting,101011));
students.put(((long)101012), new InternationalStudent("Raluca","Dumitras","New Orlens","07345286427","ralu78@Roehampton.ac.uk",new Date(),-5000,Course.Business,101012));
students.put(((long)101013), new HomeStudent("Filimon","Razvan","Cluj-Napoca","07597153479","filian@Roehampton.ac.uk",new Date(),-2000,Course.Accounting,101013));

menu () ;
private static void menu () {



System.out.println("***********************");
System.out.println(" * Bright Future *");
System.out.println("***********************");
System.out.println("1.Enroll");
System.out.println("2.Pay Fees");
System.out.println("3.List of Students on Course");
System.out.println("4.Change Course");
System.out.println("5.View Students Profile");
System.out.println("Remove Student From A Course");
System.out.println("\t **** Management Reporting ****");
System.out.println("\t Exit");
System.out.print("Enter Option:");
byte option = input.nextByte(); input.nextLine();
Patrice T 13-Aug-18 4:45am    
Use Improve question to update your question.
So that everyone can pay attention to this information.

Look at the error message, and at the code immediately before the function it is complaining about - very often the line that the compiler reports a problem with is after the actual error because that's when the problem is detectable. Much the same way that you only find a page is missing from a book because a sentence that starts before the missing page doesn't end on the next one!
 
Share this answer
 
Comments
Member 13946636 13-Aug-18 4:30am    
It says illegal start of expression,this is the error i get
OriginalGriff 13-Aug-18 4:33am    
So look at the code before that!
You should try to add a '}' there
Java
menu () ;
} // try to add this line
private static void menu () {
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900