The main() Method A Java program needs to start its execution somewhere. A Java program starts by executing the main method of some class . You can choose the name of the class to execute, but not the name of the method. The method must always be called main .