Skip to content

Commit 70d5cd5

Browse files
Add files via upload
1 parent c8f00f4 commit 70d5cd5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

SortedMap5.java

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

0 commit comments

Comments
 (0)