import java.util.*;
public class EntrySets {
public static void main(String[] args) {
Map<Object, Object> map = new HashMap<Object, Object>();
map.put("k1", "v1");
map.put("k2", "v2");
getItem(map);
List<Object> kk = new ArrayList<Object>();
kk.add("1");
kk.add("aa");
kk.add("A");
print(sortList(kk));
}
static void getItem(Map map) {
map.forEach((key, value) -> print(key + ":" + value));
}
static void iterByKey(Map map) {
/** iter map by key */
for (Object k : map.keySet()) {
String v = map.get(k).toString();
}
}
static void print(Object o) {
System.out.println(o);
}
static List sortList(List list){
Collections.sort(list);
// 反转
//Collections.reverse(list);
return list ;
}
}