class zhigong
{
private String name;
private String id;
private double pay;
void zhigong(String name,String id,double pay)
{
this.name=name;
this.id=id;
this.pay=pay;
}
public abstract void work();
}
class putong extends zhigong
{
void putong(String name,String id,double pay)
{
super(name,id,pay);
}
void work()
{
System.out.println("puwork");
}
}
class jingli extends zhigong
{
void jingli(String name,String id,double pay,String daiyu)
{
super(name,id,pay);
this.daiyu=daiyu;
}
void work()
{
System.out.println("jingliwork");
}
}
class yingyong
{
public static void main(String[] args)
{
putong p=new putong("WANGFEI","JS01",13000);
System.out.println(p.name+","+p.id+","+p.pay);
//p.work;
jingli p1=new jingli("WANGFEI","JS02",15000,"lvyou");
System.out.println(p1.name+","+p1.id+","+p1.pay+","p1.daiyu);
//p1.work;
}
}
|
|