最近,我开始听说“ POJO”(普通的旧Java对象)。我用谷歌搜索,但仍然不太了解这个概念。谁能给我关于POJO的清晰描述?
考虑带有变量“ id,名称,地址,薪水”的“人员”类-在这种情况下如何创建POJO?代码在POJO下方吗?
public class Person {
//variables
People people = new People();
private int id;
private String name;
private String address;
private int salary;
public int getId() {
return id;
}
public String getName() {
return name;
}
public String getAddress() {
return address;
}
public int getSalary() {
return salary;
}
public void setId() {
this.id = id;
}
public void setName() {
this.name = name;
}
public void setAddress() {
this.address = address;
}
public void setSalary() {
this.salary = salary;
}
}