Can an application have multiple classes having main method?



Can an application have multiple classes having main method?..

Answer / 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

More Java Related AllOther Interview Questions

What are the risks in java security? : java security

1 Answers  


what are the steps in JDBC connectivity..???

1 Answers   IBM, SoftCom, TCS,


What is an api in java?

1 Answers  


Where is java installed?

1 Answers  


How to implement Thread

2 Answers  


there are 67 seats in train . there are only 5 seats in a row and in last row there are only 2 seats. One person can reseve only 5 seat at a time. If person reserving seat , the care is atken that he may get all in row. if seats are not available in row then the arrangement is so that person group get nearby seats. the following class is given public class seat { char name; int seat; boolean isSeatempty } 1.Draw require class digram and object diagram. 2.Write function seatallot(int noofperson) to allocate seat with seat nuber printed for the each name.

1 Answers   Sapient,


What is contextpath in java?

1 Answers  


Where is singleton design pattern used in java?

1 Answers  


why java has the size of character 2 byte ,while in c/c++ it is of 1 byte?

8 Answers   IBS,


i have make jar file but when i click in this file then arr swhow "no faund main class" plese help me in this problem becose i want to make a jar file as a dxdcutable file

1 Answers  


What is class forname java?

1 Answers  


What is jersey in java?

1 Answers  


Categories