can we override the main() method in java????

Answers were Sorted based on User's Feedback



can we override the main() method in java????..

Answer / zameer

Yes we can override the main() method in java but that main() method are not declare static keyword.
If main() method is static then we can not override

Is This Answer Correct ?    4 Yes 2 No

can we override the main() method in java????..

Answer / kapil

yes we can override the main method but different argument
bcz jvm always look for String[] args argument

Is This Answer Correct ?    2 Yes 3 No

can we override the main() method in java????..

Answer / rajkumar

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

Is This Answer Correct ?    4 Yes 10 No

Post New Answer

More Core Java Interview Questions

How many types of constructors are used in java?

0 Answers  


Explain what do you mean by functional overloading in java?

0 Answers   Maveric, Verifone,


What is nested loop? What is dangling else condition in it?

0 Answers   Ericsson,


How to create com object in Java?

0 Answers  


Difference between the paint() and repaint() methods?

1 Answers  






What is the difference between C++ and Java and your preferences?

0 Answers   Expedia,


What is a classloader in java?

0 Answers  


If two threads have same priority which thread will be executed first ?

0 Answers  


List the interfaces which extends collection interface?

0 Answers  


How Applets & Servlets will communicate with each other?

2 Answers  


When we give defination of interface method in the class why method must be public???

2 Answers  


Can private class be inherited in java?

0 Answers  


Categories