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

What are library required to connect to excel sheet.

2 Answers   Cap Gemini,


What is design pattern and there types?

2 Answers   Cap Gemini,


Which Math method is used to calculate the absolute value of a number?

3 Answers   Accenture,


Can we convert stringbuffer to string?

0 Answers  


what is difference between abstract factory and factory design patterns?

0 Answers  






Can we have a abstract class withought any method? What is a purspose of this?

3 Answers  


What do you understand by copy constructor in java?

0 Answers  


What is the difference between the paint() and repaint() methods in java programming?

0 Answers  


In Inheritance if we are implementing Multi level inheritance and all class having same name of variable and now i want to access each class variable and how it is possible?

2 Answers  


Can list have duplicates in java?

0 Answers  


what is polymorhism what is inheritance? what is Abstract n Interface? what if two interfaces have same method and a concrete class is implementing both the interfaces. Will there be a compilation error? What are mutable and immutable classes? How can u make a class mutable? when will u use dem ...explain with example? what is overriding and overloading? what is garbage collection? what is Thread? how do dey communicate? what are the different ways of implementing ? have u used any messaging technologies? what is synchronization? what are some additions in java 1.5? what are generics? whst is advanced for loop? what is finally block? can u have a try in finally? yes!! can u have a finally in finally? how do you write junits? when is a object eligible for garbage collection?explain? a = null and b has ref to a will b be eligible to be garbage collected? sql questions like diff joins? how do dey work? exception handling? what is marker interface? what is the need??

0 Answers   JPMorgan Chase,


How does class forname work in java?

0 Answers  


Categories