Skip to content

Commit 2bb4b02

Browse files
Add files via upload
1 parent 3853623 commit 2bb4b02

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

NavigableMap16.java

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import java.util.NavigableMap;
2+
import java.util.TreeMap;
3+
public class NavigableMap16 {
4+
public static void main(String[] args) throws Exception {
5+
// pollLastEntry
6+
NavigableMap<Float, Integer> map = new TreeMap<>();
7+
map.put(1.8f, 11);
8+
map.put(2.6f, 9);
9+
map.put(3.4f, 78);
10+
map.put(4.3f, 5);
11+
map.put(5.6f, 1);
12+
map.put(6.8f, 3);
13+
System.out.println("Map:" + map);
14+
System.out.println("lastEntry:" + map.pollLastEntry());
15+
System.out.println("Map:" + map);
16+
}
17+
}

0 commit comments

Comments
 (0)