944,014 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 3757
  • Java RSS
Nov 11th, 2004
0

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

Expand Post »
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?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Maria5683 is offline Offline
7 posts
since Nov 2004
Nov 11th, 2004
0

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

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.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: what is the effect of using constructors in the program?
Next Thread in Java Forum Timeline: problem in hotmail





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC