score:2

Accepted answer

i suspect that the signature of your method is wrong. it has to be exactly:

public static void main(string[])

otherwise it won't work. naming the method main will fail, omitting the argument to the method will fail. also, i think the class needs to be public.

score:0

are you sure that you have a method of the type
public static void main(string[] args) ?

you should check if you have no typos in your code. maybe you could post an example of your main-method's head.

score:0

one shortcut that really helps me, eclipse has syntax suggestions, and if you type "main" into the terminal window and hit control + space, you can choose main method and it'll populate it complete with enclosed braces. helpful if you're not always quick to remember syntax off the top of your head!


Related Query

More Query from same tag