Site hosted by Angelfire.com: Build your free website today!
 

Hiding Member Varaibles

class Super {
    Integer aNumber;
}
class Sub extends Super {
    Float aNumber;
}

Be careful to hide only those member variables that you actually wish to hide.

The aNumber variable in Sub hides aNumber in Super. But you can access Super's aNumber from Sub with

super.aNumber

super is a Java language keyword that allows a method to refer to hidden variables and overridden methods of the superclass.