import com.google.common.collect.ConcurrentLinkedHashMap; public class CLHMExample { public static void main(String[] args) { ConcurrentLinkedHashMap<Integer, String> clhm = new ConcurrentLinkedHashMap.Builder<Integer, String>() .maximumWeightedCapacity(100) .build(); clhm.put(1, "Value 1"); clhm.put(2, "Value 2"); clhm.put(3, "Value 3"); String value = clhm.get(1); for (Integer key : clhm.keySet()) { System.out.println(key + ": " + clhm.get(key)); } } }


上一篇:
下一篇:
切换中文