package cn.com.student;
/**
* 测试主类
* @author Administrator
*
*/
public class Test {
public static void main(String[] args){
Undergraduate u=new Undergraduate("李四",23,"本科","计算机");
//调用子类的show()方法,打印出本科生的所有信息
u.show();
Graduate g=new Graduate("张丽",24,"本科","会计");
//调用子类的shhow()方法,打印出研究生的所有信息
g.show();
}
}
|