Help on error message, illegal start an ';' expected

Reply

Join Date: Nov 2004
Posts: 7
Reputation: Maria5683 is an unknown quantity at this point 
Solved Threads: 0
Maria5683 Maria5683 is offline Offline
Newbie Poster

Help on error message, illegal start an ';' expected

 
0
  #1
Nov 11th, 2004
I am getting the following syntax messages:

illegal start of expression public void display_menu()
(with arrow pointing to the 'p')

and also

';' expected } (with arrow also pointing to the })

This is my code for the first error:

public class InsyStudent extends Student
{

public InsyStudent( String fName, String lName, String ssn )
{

int midTerm;
int finalExam;
int researchProject;
int presentationScore;


public void display_menu()
{
System.out.println( "1) INSY 3305\n2) INSY 3305\n3) INSY 4304");
System.out.println("4) INSY 4305\n5) INSY 4310\n6) INSY 4320\n" );

}

This is my code for the second error:

public String toString()
{
return String.format( "%s %s\t%s", super.toString(), selectCourse() );
}

}

What is the problem?
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,144
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Help on error message, illegal start an ';' expected

 
0
  #2
Nov 11th, 2004
first: You're not closing your constructor, check your braces!

second: count the arguments to String.format(). Your template string takes 3 arguments, you supply only 2.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC