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
Which javutil classes and interfaces support event handling?
What you mean by COM and DCOM?
What is the diffrence between a local-tx-datasource and a xa-datasource?
whats is statement and procedure
How will you pass parameters in RMI? Why do you serialize?
what are RemoteObjects?
What is the RMI and Socket?
Is the session factory thread safe?
What is bean? Where can it be used?
How a component can be placed on Windows?
What are the different algorithms used for clustering?
How primary key is implemented in Oracle?
How are the elements of a borderlayout organized?
What are the different approaches to represent an inheritance hierarchy?
Can constructors be synchronized in java?