abstract 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 Manage extends Employee
{
private int bouns;
Manage(String name,String id,double pay,int bouns)
{
super(name,id,pay);
this.bouns=bouns;
}
public void work()
{
System.out.println("gaoji");
}
}
class Pro extends Employee
{
Pro(String name,String id,double pay)
{
super(name,id,pay);
}
public void work()
{
System.out.println("diji");
}
}
class AbstractDemo1
{
public static void main(String[] args)
{
Manage m=new Manage ("经理","110","0.5",500000);
m.work();
}
}
运行结果是:
F:\Editplus\practice>javac AbstractDemo1.java
AbstractDemo1.java:44: 找不到符号
符号: 构造函数 Manage(java.lang.String,java.lang.String,java.lang.String,int)
位置: 类 Manage
Manage m=new Manage ("经理","110","0.5",500000);
^
1 错误
|