package abstractDemo;
abstract class Employee{
private String name;
private String id;
private int age;
private double pay;
Employee(String name,String id,int age,double pay){
this.name=name;
this.id=id;
this.age=age;
this.pay=pay;
}
abstract void work();
}
class Manager extends Employee{
private int bonus;
Manager(String name,String id,int age,double pay,int bonus){
super(name,id,age,pay);
this.bonus=bonus;
}
void work(){
System.out.println("manager work");
}
}
public class abstractDemo {
public static void main(String[] args) {
// TODO 自动生成的方法存根
Manager m=new Manager("lisi", "0921", 34, 10000, 3421);
m.work();
}
}
|