package cn.org.matrix.test; import cn.org.matrix.test.A; /** * <p>Title: protect, private and upcasting </p> * <p>Description: email:chris@matrix.org.cn</p> * <p>Copyright: Matrix Copyright (c) 2003</p> * <p>Company: Matrix.org.cn</p> * @author chris * @version 1.0,who use this example pls remain the declare */ public class B extends A { protected int protectedb = 0; protected int protectedab = 0;
public class A { private int two(int i) { return i; } } class Test extends A { public static void main(String[] args) { System.out.println(A.two(3)); } }