Skip to content

Commit b0ece18

Browse files
Add files via upload
1 parent f76453c commit b0ece18

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

SortedMap3.java

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

0 commit comments

Comments
 (0)