public class InheritDataMembers
{
	class A           { protected int foo = 3; }
	class B extends A { protected int foo = 4; }

	public void go()
	{
		A x = new A();
		A y = new B();
		B z = new B();
		System.out.println("x.foo is "+x.foo);
		System.out.println("y.foo is "+y.foo);
		System.out.println("z.foo is "+z.foo);
	}

	public static void main (String[] args)
	{
		new InheritDataMembers().go();
	}
}

/* Compiles without error or warning.  A.foo is shadowed.
 * Output:

x.foo is 3
y.foo is 3
z.foo is 4

*/

