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?

Edited by happygeek: fixed formatting

12 Years
Discussion Span
Last Post by jwenting

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.