Variables are not inherited, they are hidden. It means the there are two varaibles in sub class, one is variable x present in Class A and other is x in Class B. So here as u r accessing x, the JVM will first search if that variable is present in ur class, if the varaible is defined in ur class, if not it searches its super class and finally comes up with the result. I hope thats ok with u
Hi, Members are not overriding. If you declared the member in subclass i.e,. available in superclass that memeber will be shadowing. This is also called as instance memeber hiding.
Raghu J<br />SCJP 1.4<br /> <br />The Wind and waters are always<br />on the side of the ablest navigators.<br /><a href="http://groups.yahoo.com/group/scjp_share" target="_blank" rel="nofollow">SCJP Group</a><br /><a href="http://groups.yahoo.com/group/JavaBeat_SCWCD" target="_blank" rel="nofollow">SCWCD Group</a>