Skip to content
← Back to Community
Why does main have to be a file called Main.java
Profile icon
bobkpear

Why do I have to call the main program main. The name of the file is GraphisRunner and it contains the main class and other methods. It works fine in Eclipse.

Voters
Profile icon
SJ-11WP-688113
Profile icon
bobkpear
Comments
hotnewtop
Profile icon
CodeLongAndPros

The file name HAS to be the class name.
Also, you need brackets defining your class.