user image

Pooja Sharma

Job Interview Skills
English
2 years ago

19. Can an application have multiple classes having main() method?

user image

Abhishek Mishra

2 years ago

Yes it is possible. While starting the application we mention the class name to be run. The JVM will look for the Main method only in the class whose name you have mentioned. Hence there is not conflict amongst the multiple classes having main() method.

Recent Doubts

Close [x]