can a static method be overridden
Answer Posted / karthik narayanan
also when you implement the same static method, in both
parent and subclass , and if you an instance of subclass and
say if your instance.thatstaticMethod(), the subclass
version will execute, but now if you typecast subclass to
the parent class and then execute
parentInstance.thestaticMethod() the parents version will
execute. this is different from overriding where even if
you typecast , the subclass version of the method will
execute. So basically, you can hide a static method
execution from a subclass, but you cannot override it.
understand???
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is aop(assepct oriented programing)?
What is the highest-level event class of the event-delegation model?
What method is invoked to cause an object to begin executing as a separate thread?
what is an isolation level?
What is the immediate superclass of the applet class?
What is the purpose of the notifyall() method?
Explain about local interfaces.
Difference between swing and awt?
What is TL and its use?
What is the difference between system.out ,system.err and system.in?
What is glasgow?
Java is fully object oriented languages or not?
What is a modular application? What does module-relative mean?
Is the session factory thread safe?
A user of a web application sees a jsessionid argument in the URL whenever a resource is accessed. What does this mean? a. The form must have the field jsessionid b. URL rewriting is used as the session method c. Cookies are used for managing sessions