adspace
Can an application have multiple classes having main method?
Answer Posted / Vijay Kumar Chauhan
Yes, an application can have multiple classes with a main method. However, only one of them should be designated as the entry point for execution by marking it as public static void main(String[] args). The rest of the main methods in other classes serve their purpose within the application but do not start the execution.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What do you understand by casting in java language? What are the types of casting?
Can we extract main method from another class?
How does java handle integer overflows and underflows?
What is the resourcebundle class?
What is the locale class?
Are jvm’s platform independent?
What is the first argument of the string array in main method?
What if I write static public void instead of public static void?
what is reflection api? How are they implemented?
What is the java api?