We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b0ece18 commit c8f00f4Copy full SHA for c8f00f4
SortedMap4.java
@@ -0,0 +1,13 @@
1
+import java.util.TreeMap;
2
+import java.util.SortedMap;
3
+public class SortedMap4 {
4
+ public static void main(String[] args) throws Exception {
5
+ // lastKey
6
+ SortedMap<String, Integer> map = new TreeMap<>();
7
+ map.put("a", 1);
8
+ map.put("b", 2);
9
+ map.put("c", 3);
10
+ System.out.println("Map:" + map);
11
+ System.out.println("Last Key:" + map.lastKey());
12
+ }
13
+}
0 commit comments