25) Inheritance Pitfalls

Reference Variables and Object types:

1) Using a variable of the derived class to access its own object:

2) Using a variable of a superclass to access an object of a derived class:

3) Using a variable of an implemented interface to access a derived class object:

4) Need for accessing an object using the variables of its base class or implemented interfaces:

Problem:

Last updated