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

Is map sorted in java?

820


What is core java called?

727


why not override thread to make a runnable? : Java thread

760


Explain about doubly linked list

833


Can an interface have a constructor?

728


What is a priority queue java?

731


Why char array is favored over string for the storage of passwords?

783


Explain enumeration in java?

781


What is hash table in java?

684


What is default exception handling in java?

774


What are generic methods?

735


What's a method in programming?

761


Write a function for palindrome and factorial and explain?

863


What is a variable and constant?

775


How do you get the length of a string in java?

747