Why should main be present in a Java class? -
this question has answer here:
- why java main method static? 37 answers
why should declare main
method? know main
method starting point of class. why should declare public static void main(string args[])
?
why can't declare public static void test(string args[])
? main
key word? how jvm know starting point?
the jvm has know somehow starting point of program is. way designers chose mark call entry method main
, because same name used purpose in c (which programmers familiar @ time) , makes sense. there's nothing particularly magical name, had choose something, , practical choice.
Comments
Post a Comment