GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  J2EE  >  Core Java

 Print  |  
Question:  Can we declare multiple main() methods in multiple classes.ie can we have each main method in its class in our program?



May 05, 2007 09:37:31 #8
 Aashi   Member Since: Visitor    Total Comments: N/A 

RE: can we declare multiple main() methods in multiple...
 
Yes we can declare multiple main method in various classes. When you compile, it creates many class files. Run any class that has main method it will execute only that class. It works my friend
     

 

Back To Question