Description of main() method in java

public static void main(string args[])

public: This method is declared public so that it is accessible by JVM.

static: static members do not need instance of the class. So JVM can directly start the execution from the main() method.

void: This method do not return any value so it is declared void.

main(): It is an identifier which identifies main method from within a class.

(String args[]): This string array of argument is used to take input from the user using command line arguments.

Leave a Reply

Your email address will not be published. Required fields are marked *