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 is a lightweight component?

0 Answers  


Why does java not support operator overloading?

0 Answers  


What is the default size of load factor in hashing based collection?

0 Answers  


What is the console in java?

0 Answers  


What is the difference between a choice and a list?

0 Answers  


how many types of Inheritance?

0 Answers   Impetus,


What do you understand by Header linked List?

0 Answers   Genpact,


What is empty string literal in java?

0 Answers  


What is Classloader in Java?

0 Answers  


What is ternary operator? Give an example.

0 Answers  


What is the use of callablestatement?

0 Answers  


how to print hello world every second till i have pressed enter key ???

1 Answers   SAP Labs,


Categories