代码基本实现
未完待续...........
public static void main(String[] args) { TreeMap<Integer,String> hashNodes = new TreeMap<>(); hashNodes.put(1,"1.1.1.1"); hashNodes.put(4,"1.1.1.2"); hashNodes.put(7,"1.1.1.3"); hashNodes.put(8,"1.2.2.2"); hashNodes.put(11,"1.2.2.3"); SortedMap<Integer, String> sortedMap = hashNodes.tailMap(2); Integer firstKey = sortedMap.firstKey(); System.out.println(firstKey); System.out.println(sortedMap.get(firstKey)); }
标签:java,哈希,1.2,sortedMap,firstKey,put,hashNodes,一致性,1.1 From: https://www.cnblogs.com/bdefgman/p/17726457.html