public class People {
// Code to create a random set of people omitted
public Set getAllPeople() {
return people;
}
public void setPerson(Person person) {
if (person.getId() == -1) {
person.setId(getNextId());
}
people.remove(person);
people.add(person);
}
public void deletePerson(Person person) {
people.remove(person);
}
private Set people = new HashSet();
}
public class Person
{
private int id;
private String name;
private String address;
private float salary;
// Getters, setters, equals and toString omitted
}
在查看 DWR 网站时,我发现了这个示例。它指出他们省略了 Getters、setters、equals 和 toString。如何为这个程序编写这些。我想运行这个程序看看。请有任何建议。帮帮忙。。