package com.mjy.test;
import com.mjy.map.Map;
import com.mjy.map.TreeMap;
/**
* ***************************************************
* @ClassName TreeMapTest
* @Description 描述
* @Author maojianyun
* @Date 2020/1/9 23:30
* @Version V1.0
* ****************************************************
**/
public class TreeMapTest {
public static void main(String[] args) {
test1();
}
static void test1() {
Map<String, Integer> map = new TreeMap<String, Integer>();
map.put("c", 2);
map.put("a", 5);
map.put("b", 6);
map.put("a", 8);
map.put("a", 9);
map.remove("b");
System.out.println(map.containsKey("b"));
System.out.println(map.containsValue(2));
map.traversal(new Map.Visitor<String, Integer>() {
public boolean visit(String key, Integer value) {
System.out.println(key + "_" + value);
return false;
}
});
}
}
最近下载更多
matintalorr LV10
2021年8月31日
最代码官方 LV168
2020年1月11日

最近浏览