Programming in Java Illegal start of expression error

Asked By 0 points N/A Posted on -
qa-featured

Hello,

I'm new to programming in Java and I want to know if there is anyone who's on advanced level of programming what means "Illegal start of expression" error that the java compiler "Netbeans" gives to me, in my opinion everything is ok.

The identifiers are ok, there is no punctuation problem.

The whole thing is that i want to create a method in the main class and in the public static void  main () method, so that i could manage the fields from that class.

Anyone please answer me !

Illegal start of expression.

illegal start of expression

read(java.lang.String) is already defined in BufferedInputFile

missing return statement

(Alt+Enter shows hints)

SHARE
Answered By 0 points N/A #84209

Programming in Java Illegal start of expression error

qa-featured

Several solutions about your problem the.

First: You have to cut the code where you're trying to create a method in main method and paste it after you close the main method, in the same class.

Second: You can create a new class in the same package and declare your method there, also you will need to create an object from that class in your main method and call the function you want using that object.

Login/Register to Answer

Related Questions