can a static method be overridden
Answer Posted / kiran kadarla
Static methods CANNOT be overridden as they belong to a
class and not an instance of the class.
Aswini De: First of all, you didnot override the cal method.
Karteek: In your example, the fact that
parent.mystaticMethod and child.mystaticmethod are printing
different answers is in itslef an indication that the method
is not overridden!!
-kk
| Is This Answer Correct ? | 9 Yes | 9 No |
Post New Answer View All Answers
What is the purpose of the notifyall() method?
Write a singleton program?
What is a class loader? What are the different class loaders used by jvm?
What is RMI and what are the services in RMI?
What is the purpose of the wait() method?
What class is used to create Server side object ?
Define prototype?
How would you create a button with rounded edges?
Do I have to use jsps with my application?
What is the difference between system.out ,system.err and system.in?
Is the session factory thread safe?
How database connectivity in XML is achieved?
Why doesn’t the focus feature on the tag work in every circumstance?
what are getters and setters in Java with examples?
what are the advantages of JTA over JTS?