How can we write S.O.P(super.x) which should only be possible if super was a reference variable?
Is super a reference variable?
If not, does it mean that we can access non static data members stored in objects without the following syntax "reference variable"."data member"?
Few points about
super1.)
superis a keyword in java2.) A
staticorinstancevariable in asubclassmay have the same name as asuperclassvariable. In this case, the variable hides thesuperclassvariable and it can have same type or different types.3.) It is possible to access
hidden variablebysuperkeyword.4.) Note that super keyword enables you to access the superclass variable and construct a subclass by using the same variable name.