GeekInterview.com
Series: Subject: Topic:
Question: 10 of 573

Is it possible to override the main method in Java?

if yes then how?
Asked by: aparesh_c | Member Since May-2007 | Asked on: Aug 4th, 2012

View all questions by aparesh_c

Showing Answers 1 - 5 of 5 Answers
Ajinkya

Answered On : Aug 7th, 2012

No. We can not override main method. As it is static and static methods can not be overridden

  
Login to rate this answer.
Mohammed Mansoor

Answered On : Aug 31st, 2012

Yes, it can be overridden but it will act as a normal method but not as main method

Yes  1 User has rated as useful.
  
Login to rate this answer.
mansoor

Answered On : Aug 31st, 2012

No it cannot be overided but it can be overloaded

  
Login to rate this answer.
avinash

Answered On : Sep 26th, 2012

we cant override static methods in java.if we take main() in sub class that is method hiding not overriding.

  
Login to rate this answer.
RAJASEKAR

Answered On : Oct 27th, 2012

No because we all know we cannot override static method. It is a final method.

main method is static.

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.