标签:
boolean accessOrder = true;
Map<String, String> m = new LinkedHashMap<String, String>(20, .80f,accessOrder);
m.put("1", "test1");
m.put("2", "test2");
m.put("3", "test3");
System.out.println(m); //{1=test1, 2=test2, 3=test3}
Map<String, String> m = new LinkedHashMap<String, String>(20, .80f,accessOrder);
m.put("1", "test1");
m.put("2", "test2");
m.put("3", "test3");
m.get("1");
m.get("2");
System.out.println(m); //{3=test3, 1=test1, 2=test2}
boolean accessOrder = false;
Map<String, String> m = new LinkedHashMap<String, String>(20, .80f,accessOrder);
m.put("1", "test1");
m.put("2", "test2");
m.put("3", "test3");
System.out.println(m); //{1=test1, 2=test2, 3=test3}
boolean accessOrder = false;
Map<String, String> m = new LinkedHashMap<String, String>(20, .80f,accessOrder);
m.put("1", "test1");
m.put("2", "test2");
m.put("3", "test3");
m.get("1");
m.get("2");
System.out.println(m); //{1=test1, 2=test2, 3=test3}
标签:
原文地址:http://www.cnblogs.com/wikiki/p/4346764.html