新手求教。请问声明这样一个泛型
List> list = new List>();
怎么往里面添加数据 比如想在里面添加一个键值对 键为‘1’ 值为 1的数据
list.add(里面怎么写?);
Dictionary dic = new Dictionary();
dic.Add('1',1);
List> list = new List>();
list.Add(dic);
线new一个Dictionary,然后add到list
用hashmap不,比较简单
List> arrayList = new ArrayList>();
HashMap hashMap = new HashMap();
hashMap.put('1', 1)
arrayList.add(hashMap);