Explain public static void main(String args[]) in Java.
public it specify the accesss level of the method which can be accessed by any class.
static we have to declare the main method as static so that we can call this method without intializing the class, we can call this method directly bu using class name.If we didnt decalre this method as static mean the JVM will throw an error saying the main method is not declared static.
void it says the method has no return type
main its is the entry point of JVM. The JVM execute the program by invoking this main method.
String args[] is the parameter passed to the main method.
Knowledge is everything.Check out my app at https://play.google.com/store/apps/details?id=com.vibe.britevibe
Love podcasts or audiobooks? Learn on the go with our new app.