Friday 5 April 2013

What is Overriding?

What is Overriding?

To override a method, a subclass of the class that originally declared the method must declare a method with the same name, return type (or a subclass of that return type), and same parameter list.
The definition of the method overriding is:
· Must have same method name. 
· Must have same data type. 
· Must have same argument list. 
Overriding a method means that replacing a method functionality in child class. To imply overriding functionality we need parent and child classes. In the child class you define the same method signature as one defined in the parent class.



Blog Author: Vijay Kumar

No comments:

Post a Comment