//父类A的定义
package ch06_06;
public class A {
	private int a;
	public void print(){
        System.out.println("父类A：其属性及其属性值a="+a);
     }
	public A(int a) {
		this.a = a;
	}
	public A() {}	
}
//子类B的定义
package ch06_06;
public class B extends A {
	private int b;
	public B(int a, int b) {
		super(a);
		this.b = b;
	}
	public B() {}
    public void print(){
        System.out.println("子类B，其属性及其属性值b="+b); 
    }
    public void printAB(){ 
        super.print() ;
        print();
    }
}
//主类Test的定义
package ch06_06;
public class Test {
	public static void main(String[] args) {
	    A a=new A(10);
         a.print();
         B b=new B(100,200);
         b.print();
         b.printAB();
	}
}
