Click here to Skip to main content
13,739,613 members
Rate this:
 
Please Sign up or sign in to vote.
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




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 12-Aug-18 7:01am
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?
13-Aug-18 4:29am
   
It says illegal start of expression
Patrice T 13-Aug-18 4:37am
   
What is the code before this ?
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.
13-Aug-18 4:47am
   
Thank you
Patrice T 12-Aug-18 17:20pm
   
(the error is here at the private static void menu I have it marked with red )
And you have found the error message ?
13-Aug-18 4:31am
   
It says illegal start of expression
Dave Kreskowiak 12-Aug-18 20:46pm
   
Without the error message that's being thrown, there's nothing anyone can do to help you.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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!
  Permalink  
Comments
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!
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

You should try to add a '}' there
menu () ;
} // try to add this line
private static void menu () {
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web01-2016 | 2.8.180920.1 | Last Updated 13 Aug 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100