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?



April 04, 2007 13:14:49 #7
 naresh   Member Since: Visitor    Total Comments: N/A 

RE: can we declare multiple main() methods in multiple...
 
yes we can declare. but we can run only one at a time. whatever method we want to execute we hv to give command as       c:/java <name>   no matter of whwich name our file is saved
     

 

Back To Question