There's a wee bit of magic involved. Really it's just a convention established by the inventors of the language. When you start a Java program at the commandline "java ClassName" the Java runtime loads the class and calls the main() method. The runtime also puts any parameters you entered on the commandline into the
String[] parameter for main.
So when you see a main() method, it means you can start the class from the command line. Sometimes that means it is "the program of interest" or the thing people actually want to start up from the command line. Sometimes the main method is just for
testing. Some classes that you would never run as a program from the command line have test code or examples of how to call methods in the main.
If you're using an
IDE like Eclipse you usually have a "run" button of some kind instead of using the command line launch.
hope that helped!