---
title: "Can an application have multiple classes having main method?"  
description: "Can an application have multiple classes having main method?"  
author: "Anonymous User"  
published: 2015-07-21  
updated: 2020-09-21  
canonical: https://www.mindstick.com/interview/2720/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 Anonymous User

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/2720/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.
