NavigableMap<String, String> nm = new TreeMap<String, String>();
nm.put("1", "one");
nm.put("3", "three");
nm.put("2", "two");
nm.put("4", "four");
NavigableSet<String> keys = nm.keySet();
NavigableSet<String> subKeys = keys.subSet("1", true, "3", false);
for(String s: subKeys) {
System.out.print(s + " ");
}
Login in to like
Login in to comment