Is it possible to override the main method in Java?

If yes then how?

Questions by aparesh_c

Showing Answers 1 - 0 of 0 Answers

Ajinkya

  • Aug 7th, 2012
 

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

  Was this answer useful?  Yes

Mohammed Mansoor

  • Aug 31st, 2012
 

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

mansoor

  • Aug 31st, 2012
 

No it cannot be overided but it can be overloaded

  Was this answer useful?  Yes

avinash

  • Sep 26th, 2012
 

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

  Was this answer useful?  Yes

RAJASEKAR

  • Oct 27th, 2012
 

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

main method is static.

  Was this answer useful?  Yes

Give your answer:

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

 

Related Answered Questions

 

Related Open Questions