Answer Posted / nikhil agrawal
Main method is static and static method is not override.
For example:- if i have Class A having main method and Class B extends Class A and also having the main method. in that case Class B hide the main method of A not override.
overriding process occur on run time and but static method load on compile time. that's its the reason we can not override main method but we can hide it.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the use of inner class?
How do you create a sop?
What is difference between iterator and enumeration in java?
Why do we override tostring method in java?
Can java run on google chrome?
Can you make a constructor final?
What is string variable?
What is the private method modifier?
Which method cannot be overridden in java?
Can list have duplicates in java?
What is the use of a copy constructor?
Does treeset use compareto?
Explain when classnotfoundexception will be raised ?
Why is stringbuffer not immutable?
How we can declare a static variable?