增加map.headMap测试样例 (#4)

Reviewed-on: #4
This commit is contained in:
LingZhaoHui 2023-12-29 13:35:37 +00:00
parent 0c5c96c90a
commit 1bfbe6d6a4
1 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,19 @@
package com.zeekling.cn.map.sortedmap;
import java.util.SortedMap;
import java.util.TreeMap;
public class HeadMap {
public static void main(String[] args) {
SortedMap<String, String> mp = new TreeMap<>();
mp.put("One", "Geeks");
mp.put("Two", "For");
mp.put("Three", "Geeks");
mp.put("Four", "Code");
mp.put("Five", "It");
// 返回键小于H的映射
System.out.print(mp.headMap("H"));
}
}