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

Why main method is called first in java?

0 Answers  


Explain how hashmap works?

0 Answers  


What is appletviewer?

0 Answers  


write a program to create an vector with string(add,remove) operation.and value should be enter through keyboard.

0 Answers   Axcend,


What is singleton class in ruby?

0 Answers  


What is the multilevel inheritance. and also give the Example of it ?

5 Answers  


What is local class in java?

0 Answers  


What is meant by tab pans?

0 Answers  


How many bits is a string in java?

0 Answers  


Garbage collection in java?

0 Answers  


what is difference between excute query ()and execute update ()?

6 Answers   Symphony,


How do you create a bulleted list?

0 Answers  


Categories