|
Data Structure Class
Listing 1. In this simple class for an employee data structure the accessor methods follow a get/set naming convention allowing the bean serializer/deserializer to recognize them automatically. public class Employee {
private String first;
private String last;
private int number;
public Employee() {
}
public Employee(String first, String last,
int number) {
this.first = first;
this.last = last;
this.number = number;
}
public String getFirst() {
return first;
}
public void setFirst(String first) {
this.first = first;
}
public String getLast() {
return last;
}
public void setLast(String last) {
this.last = last;
}
public void setNumber(int number) {
this.number = number;
}
public int getNumber() {
return number;
}
}
|