Saturday, 23 April 2016

Why main method is void, static and public ?


public
so that it can be accessed by the JVM

static
so that it can be invoked without instantiating the main class by the JVM


void
There is no need to return anything


Main method arguments
arguments are passed with invoking the application


No comments:

Post a Comment

Note: only a member of this blog may post a comment.