Q. Why we use super keyword?
=============================================================
-> Whenever we inherit the base class features into derived class there is a possibility
that base class features are similar to derived class features.
-> Due to this, JVM get an ambiguity problem.
-> In order to differentiate between Base class features and Derived class features, for
Base class features must be always proceed by super keyword.
***
-> In other words, super is a keyword which is used for differentiate between Base class
features and Derived class features.
*****
-> super keyword is playing an important role in three places. They are:
1. At variable level
2. At method level
3. At constructor level
=============================================================
-> Whenever we inherit the base class features into derived class there is a possibility
that base class features are similar to derived class features.
-> Due to this, JVM get an ambiguity problem.
-> In order to differentiate between Base class features and Derived class features, for
Base class features must be always proceed by super keyword.
***
-> In other words, super is a keyword which is used for differentiate between Base class
features and Derived class features.
*****
-> super keyword is playing an important role in three places. They are:
1. At variable level
2. At method level
3. At constructor level
Comments
Post a Comment