can a static method be overridden
Answer Posted / karthik narayanan
Basically there are two concepts, one is overriding and the
other is hiding. When a subclass implements the same static
method as its parent class, then subclass will basically
hide the parents static implementation. So when you call
subclasses static method, only subclass method will get
executed. To execute the parents static method you have to
explicitly call it. But with instance method, you can hide
as well override the parent implementation, override in the
sense you can call the parent implementation by
super.dosamemethod()...
Hopefully this clears the debate..
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain the difference between object state and behavior?
In inglish: How to convert jar to exe files? Em português: Como converter arquivos .jar para .exe?
What is permgen or permanent generation?
What’s jboss cache in short?
What is a policy?
Can I use multiple html form elements with the same name?
What modifiers may be used with an interface declaration?
What is the argument type of a programs main() method?
Describe responsibilities of Activator?
Why a component architecture for the java platform?
What are the purpose of introspection?
what is an isolation level?
What is abstract schema?
Define aop(assepct oriented programing)?
What is table mutation and how do you avoid it?