{
private String name;
private int age;
private String sex;
员工(String name,int age,String sex)
{
this.name=name;
this.age=age;
this.sex=sex;
}
public String getName()
{
return name;
}
public int getAge()
{
return age;
}
public String getSex()
{
if(sex.equals("男")==true)
return "男";
else if(sex.equals("女")==true)
return "女";
else
return "东方不败";
}
public String toString()
{
return "姓名"+getName()+"年龄"+getAge()+"性别"+getSex();
}
public void setName(int name)
{
this.name=name;
}
public void setAge(int age)
{
this.age=age;
}
public void setSex(String sex)
{
this.sex=sex;
}
}
class Manager extends 员工
{
private int jiangjin;
Manager(int jangjin)
{
super("Manager");
jiangjin=0;
}
public void setJiangjin(int s)
{
jiangjin=s;
}
public String toString()
{
return super.toString()+"奖金"+jiangjin;
}
}
import java.lang.*;
public class Bh2
{
public static void main(String args[])
{
员工 老张=new 员工("张三",45,"男");
System.out.println(老张.toString());
Manager 老马=new Manager("马大帅",46,"男",2400);
System.out.println(老马.toString);
}
}//请大家帮忙把错误给我说下
谢谢拉