本帖最后由 张向辉 于 2013-1-29 11:48 编辑
public class Demo2 {
private int id;
private String name;
private List<String> list = new ArrayList();// 这里的属性为什么要这样写
public Demo2() {
super();
// TODO Auto-generated constructor stub
}
public Demo2(int id, String name, List<String> list) {
super();
this.id = id;
this.name = name;
this.list = list;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<String> getList() {
return list;
}
public void setList(List<String> list) {
this.list = list;
}
}
定义属性list 为什么要这样写 private List<String> list = new ArrayList();
|
|