We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2bfd5a8 commit 3803e2eCopy full SHA for 3803e2e
NavigableMap8.java
@@ -0,0 +1,21 @@
1
+import java.util.NavigableMap;
2
+import java.util.TreeMap;
3
+public class NavigableMap8 {
4
+ //headMap(K toKey, boolean inclusive)
5
+ public static void main(String[] args) throws Exception {
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("headMap:" + map.headMap(3.4f, true));
15
+ // Returns a view of the portion of this map whose keys are equal to toKey,if inclusive is true.
16
+ System.out.println("headMap:" + map.headMap(3.4f, false));
17
+ // Returns a view of the portion of this map whose keys are less than toKey,if inclusive is false.
18
+
19
+ }
20
21
+}
0 commit comments