{
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()
{
super("员工");
}
{
jiangjin=s;
}
public String toString()
{
return super("toString")+"奖金"+jiangjin;
}
}
public class Bh2
{
public static void main(String args[])
{
员工 老张=new 员工("张三",45,"男");
System.out.println(老张.toString());
Manager 老马=new Manager("马大帅",46,"男");
System.out.println(老马.toString);
}
}