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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we extend private class in java?

787


What is time complexity algorithm?

817


Can we write multiple catch blocks under single try block?

852


What is difference between fail-fast and fail-safe?

907


How do you sort in ascending order in java?

698


Explain about fail fast iterators in java?

819


What happens when a thrown exception is not handled?

820


What is the purpose of assert keyword used in jdk1.4.x?

781


What is the use of set in java?

874


Why stringbuilder is not thread safe?

797


Explain about interthread communication and how it takes place in java?

799


Why is java not 100% pure oops?

838


What is the purpose of the finally clause of a try-catch-finally statement in java programming?

732


Which are the two subclasses under exception class?

772


What is bean? Where it can be used?

853