Breaking Down main()
public static void main(String[] args)
- public: Access modifier. JVM needs to call it from outside.
- static: Can be called without creating an object of the class.
- void: Returns nothing.
- main: The name of the method searched by JVM.
- String[] args: Command line arguments.
Can we change it?
- Order:
static publicworks. - Args:
String args[]orString... argsworks. - Name: Must be
main.