Skip to content

Commit 0462dfa

Browse files
Add files via upload
1 parent 70d5cd5 commit 0462dfa

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

SortedMap6.java

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import java.util.TreeMap;
2+
import java.util.SortedMap;
3+
public class SortedMap6 {
4+
public static void main(String[] args) throws Exception {
5+
// tailMap
6+
SortedMap<String, Integer> map = new TreeMap<>();
7+
map.put("a", 1);
8+
map.put("b", 2);
9+
map.put("c", 3);
10+
map.put("d", 4);
11+
map.put("e", 5);
12+
map.put("f", 6);
13+
System.out.println("Map:" + map);
14+
System.out.println("Head Map:" + map.tailMap("e"));
15+
16+
}
17+
}

0 commit comments

Comments
 (0)