Java main() method

Java main() method is the initial point of any Java program. Below is its syntax and let’s look at each part of the Java main() method:

Method: public static void main(String args[])

public: It is set to public so that JVM call it from anywhere.

static: Without any existing object, JVM call this main() method.

void: This means main() method will not return any value to JVM.

main(): This is the name of the method which is configured in JVM.

args: This is for command line arguments.