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 does 3 dots mean in java?

0 Answers  


Why is it called buffering?

0 Answers  


what is request dispatcher and how does it work?

2 Answers   CTS,


how to connect one jsp page to another jsp page????

6 Answers   IIT, Symphony,


Can you declare a private method as static?

0 Answers   TCS,






What is null object in java?

0 Answers  


In which way does a Primitive data type is passed ?

5 Answers   Sun Microsystems,


Can memory leak in java?

0 Answers  


What is Enum in Java?

0 Answers  


Write a function to print Fibonacci series and Tribonacci series?

0 Answers   Hexaware,


Difference between character constant and string constant in java ?

0 Answers  


What is collection api?

0 Answers  


Categories