being new to java programming and a novice learner, specifically looking at the command
public static void main(String[] args)
what does public static void
mean ? and what are terms like args
meant to do ?
being new to java programming and a novice learner, specifically looking at the command
public static void main(String[] args)
what does public static void
mean ? and what are terms like args
meant to do ?
public
--> access specifier. Any other class can access this method.
static
--> The method is bound to the class, not to an instance of the class.
void
--> return type. The method doesn't return anything.
main(String[] args)
--> method name is main()
. It takes an array of String 's as argument. The String[] args
are command line arguments.
Note : The main()
method defined above is the entry point of a program, if you change the signature, then your program might not run.