Why should main be present in a Java class? -


this question has answer here:

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

Popular posts from this blog

c++ - Linked List error when inserting for the last time -

java - activate/deactivate sonar maven plugin by profile? -

java - What is the difference between String. and String.this. ? -