Can you explain the signature of main method in Java

Signature of main() method:

public static void main(String[] args)
{
   // code comes here
}

Public: It is an Access modifier, which specifies from where and who can access the method

Static: by making class as static,JVM initialize main method with out creating any object for that

Main: The point from where the program starts its execution

Void: It is a keyword and used to specify that a method doesn’t return anything

String[] args: It stores Java command line arguments and is an array of type java.lang.String class

Signature of main() method:

public static void main(String[] args)
{
   // code comes here
}

Public: It is an Access modifier, which specifies from where and who can access the method

Static: by making class as static,JVM initialize main method with out creating any object for that

Main: The point from where the program starts its execution

Void: It is a keyword and used to specify that a method doesn’t return anything

String[] args: It stores Java command line arguments and is an array of type java.lang.String class

Default image
Sriram Mannava

I'm a full-stack developer and a software enthusiast who likes to play around with cloud and tech stack out of curiosity.

Leave a Reply