1.

What Is Overriding?

Answer»

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.
Overriding a method means replacing the method's functionality in a CHILD class. To implement overriding functionality, you NEED parent and child classes. In the child class, you define the same method signature as the one defined in the parent class.

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.
Overriding a method means replacing the method's functionality in a child class. To implement overriding functionality, you need parent and child classes. In the child class, you define the same method signature as the one defined in the parent class.



Discussion

No Comment Found