public class People{ private String name; public void setName(String name){ this.name = name; } public String name{ return name; } public void setAge(int age){ this.age = age; } public int age{ return age; } } import net.sf.Json.. public class test{
Java Object Clone User user = new User(); user.setName("tom"); User user1 = new User(); user1.setName("jerry"); List<User> list = new ArrayList<>(); list.add(user1); user.setChildren(list); user.setUser(user1); System.out.p
POJO有一些private的参数作为对象的属性.然后针对每个参数定义了get和set方法作为访问的接口.例如:public class User {private long id;private String name;public void setId(long id) {this. id = id;}public void setName(String name) {this. name=name;}public long getId() {return id;}public String