User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 427,381 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,038 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 2819 | Replies: 1
Reply
Join Date: Nov 2004
Posts: 7
Reputation: Maria5683 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Maria5683 Maria5683 is offline Offline
Newbie Poster

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

  #1  
Nov 10th, 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?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2004
Location: Netherlands
Posts: 5,752
Reputation: jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough 
Rep Power: 18
Solved Threads: 199
Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

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

  #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  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Java Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Java Forum

All times are GMT -4. The time now is 4:07 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC