要求:
1).Person类有name,age,salary属性,要求实现至少两个构造方法,并且属性私有,
提供对应的getter、setter。
2).覆写toString方法,要求在System.out.println()函数中传递Person对象
能打印出三个属性值而不是对象地址。
3).覆写equals方法,要求两个Person类对象的值相同时返回true。
class Person{
private String name;
private int age;
private double salary;
public Person(String name,int age,double salary){
this.name = name;
this.age = age;
this.salary = salary;
}
public Person(String name, int age) {
this.name = name;
this.age = age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public double getSalary() {
return salary;
}
public void setSalary(double salary) {
this.salary