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 override the main method?



October 10, 2006 03:57:15 #6
 Shankar   Member Since: Visitor    Total Comments: N/A 

RE: Can we override the main method?
 
Hi ,You have rights to overload main(),but jvm can invoke only main with String[] s. not other arguments main.If u come for override both sub class and super class can hold its own main. any way we can't invoke main with help of either object ref or super. but at compile time we can't get any error suppose both super and sub has main.
     

 

Back To Question