日期:2014-05-20 浏览次数:20785 次
package com.geae.cros.bean;
import java.util.ArrayList;
import java.util.List;
public class Test {
List<First> first ;
public List<First> getFirst() {
return first;
}
public void setFirst(List<First> first) {
this.first = first;
}
public static void main(String[] args) {
Test test = new Test();
int i = 10 , j = 8 ;
First f = new First();
List<First> list = new ArrayList<First>();
while (i>0){
f.setK(j++);
System.out.println(f.getK());
f.setI("==");
System.out.println(f.getI());
list.add(f);
i--;
}
System.out.println(list.size());
test.setFirst(list);
}
}
class First {
private String i ;
private int k ;
public String getI() {
return i;
}
public void setI(String i) {
this.i = i;
}
public int getK() {
return k;
}
public void setK(int k) {
this.k = k;
}
}