// PackageAccessibility Example // Test the four kinds of accessibility: // public, protected, private, package (default). import it313.A; public class C extends A { public static void main(String[ ] args) { C c = new C( ); // _z cannot be accessed because it is private. // System.out.println(a.z); // _y can be accessed because it is protected // and an instance variable in the base class // of the current class. This works even though // A and C are not in the same package. System.out.println(c.y); // A a = new A( ); // y cannot be accessed because A is not in // the same package as the current class. // System.out.println(a.y); } }