Friday, September 6, 2013

DIFFERENCE BETWEEN METHOD OVERRIDING AND METHOD HIDING

METHOD OVERRIDING

When an instance method is written again with the same name, same number and type of parameters and same return type, in the sub-class as that of the parent-class/super-class, then this phenomenon is called as method overriding.

METHOD HIDING

It occurs in case of class-methods( also popularly known as static methods ). When any static-method is written again with the same name, same number and type of parameters and same return type, in the sub-class as that of the parent / super-class, then this phenomenon is called as method hiding.


No comments:

Post a Comment