日期:2014-05-20 浏览次数:20645 次
import java.util.HashMap;
import java.util.Map;
import java.util.ArrayList;
import java.util.List;
public class Teams{
public static void main(String args[]){
List<Map<String, Object>> list=new ArrayList<Map<String,Object>>();
Map<String, Object> map1=new HashMap<String, Object>();
map1.put("name", "jack");
map1.put("num", "basketball");
Map<String, Object> map2=new HashMap<String, Object>();
map2.put("name", "tom");
map2.put("num", "basketball");
Map<String, Object> map3=new HashMap<String, Object>();
map3.put("name", "tim");
map3.put("num", "basketball");
Map<String, Object> map4=new HashMap<String, Object>();
map4.put("name", "hhs");
map4.put("num", "football");
Map<String, Object> map5=new HashMap<String, Object>();
map5.put("name", "www");
map5.put("num", "football");
list.add(map1);
list.add(map2);
list.add(map3);
list.add(map4);
list.add(map5);
System.out.println(list.size());