The main() Method
The
main()
method is the entry point for standalone Java applications. To create an application, you write a class definition that includes a main() method.
To execute an application, type java at the command line, followed by the name of the class containing the main() method.
The signature for main() is:
public static void main(String[] args)
The return type must be
void
. The main() method must be
public
. It is static so that it can be executed without constructing an instance of the application class.