When Java starts up a program it will look for a method with the signiture -

public static void main(String args[])

This is commonly known as the entry point or main method. This is the FIRST method that Java will run so this must start the rest of your program off. When you first start with Java all of your code will be placed in the main method.

Note - If your main method contains no code then your program will do nothing! Also you will not be able to run your program without the main method.

Later on when you start creating your own classes and objects the main method will become a launch pad for them.

Next method blocks >>

 

 
Basics
Menu
Search