package ch06_04;
public class TestMain2 {
	public static void main(String[] args) {
		System.out.println("(1)父类创建的对象与显示：");
		People p1 = new People("李四", 25);
		p1.show();
		System.out.println("(2)子类创建的对象与显示：");
		Student s1 = new Student("张三", 20, "北大");	
		s1.show();
		System.out.println("(3)上转型对象的创建与显示：");
		People p2 = new Student("王五", 21, "清华");
		p2.show();
		System.out.println("(4)将上转型对象转换为子类对象后再显示信息：");		Student s2 = (Student)p2;
		s2.show();
		s2.show2();
		System.out.println("(5)父类创建的对象，直接赋值给子类对象：");	
		People p3 = new People("周六", 30);
		p3.show();
		Student s3 = (Student)p3;
		s3.show();
		s3.show2();
	}
}
