
Can anyone please explain the meaning of public static and void main in Java?


public : to be searched by the JVM easily as public can be accessible from anywhere.
static: so that main method is loaded at the compile time with the class, because JVM searches the main method during run time, so we have to load main method at the class loading time means at compile time.
void: return type not to fix otherwise we had to return something.
main: name of the method.
String []arg :It is the parameters for main method of an Array of String type. Just String is used so that the application can take any type of input as every type of datatype can be converted into String easily.