本帖最后由 旭辉lin 于 2014-9-26 09:02 编辑
- package pack3;
- public class Test3 {
- public static void main(String[] args) {
- Zi zi = new Zi();
- System.out.println(zi.a);
- System.out.println(zi.b);
- //默认的访问权限,子孙类随便用,外部类访问不了,这不外部类照样访问吗,不理解啊?
- }
- }
- class Fu{
- protected int a=3;
- int b=4;
- }
- class Zi extends Fu{
- }
复制代码
|