1. import java.util.*;
2.
3. class SomeClass {
4. public static void main(String[] args) {
5. TreeMap<String, Integer> myMap = new TreeMap<String, Integer>();
6. myMap.put("a", 50); myMap.put("b", 60);
7. myMap.put("c", 70);
8. NavigableMap<String, Integer> myMap2 = myMap.headMap("d", true);
9. myMap.put("e", 90);
10. myMap2.put("f", 100);
11. System.out.println(myMap.size() + " " + myMap2.size());
12. }
13. }
Login in to like
Login in to comment