---
title: "Can an application have multiple classes having main() method?"  
description: "Can an application have multiple classes having main() method?"  
author: "Sumit Kesarwani"  
published: 2014-08-23  
updated: 2020-09-23  
canonical: https://www.mindstick.com/interview/1985/can-an-application-have-multiple-classes-having-main-method  
category: "java"  
tags: ["java"]  
reading_time: 1 minute  

---

# Can an application have multiple classes having main() method?

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.

## Answers

### Answer by Sumit Kesarwani

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.


---

Original Source: https://www.mindstick.com/interview/1985/can-an-application-have-multiple-classes-having-main-method

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
