public class NonOverridingOfPrivateMethods
{
        public static class A { private void foo() { System.out.println("foo"); }
                                public  void go () { foo(); }}
        public static class B extends A { private void foo() { System.out.println("bar"); }}
        public static class C extends B { public  void foo() { System.out.println("baz"); }}

        public static void main (String[] args) throws Exception
        {
                C c = new C();
                c.go();
                c.foo();
        }
}

/* Output:

foo
baz

 * When A.go() calls foo(), it refers to A.foo(), even
 * though the subclasses have foo() methods as if they
 * were trying to redefine foo(). */

