class Employee
{
private String name;
private String id;
private double pay;
Employee(String name,String id,double pay)
{
this.name=name;
this.id=id;
this.pay=pay;
}
public abstract void work();
}
class Manager extends Employee
{
private int bonus;
Manager(String name,String id,double pay,int bonus)
{
super(name,id,pay);
this.bonus=bonus;
}
public void work()
{
System.out.println("manger work");
}
}
class Pro extends Employee
{
Pro(String name,String id,double pay)
{
super(name,id,pay);
}
public void work()
{
System.out.println("pro work");
}
}
class Abstract01
{
public static void main(String[] args)
{
System.out.println("manger work");
}
}
编译后爆:Employee不是抽象的,并且未覆盖Employee中的抽象方法work() class Employee
这时怎么回事??不到懂 怎么处理这个问题? 及给点抽象的说明好吗
|
|