package codeurjava.树状图;Runtime:
导入 java.util.TreeMap;
public class TreeMapCopy {
public static void main(String a[]){
TreeMaphmap = new TreeMap ();
//添加键值对等方
hmap.put(1, one”);
hmap.put(2, 二”);
hmap.put(3,三”);
hmap.put(4,四”);
hmap.put(5,五”);
hmap.put(6,六”);
System.out.println(之前的树状图:”+hmap);
System.out.println(空树状图”);
hmap.clear();
System.out.println(树状图后:”+hmap);
}
}
TreeMap before: {1=one, 2=two, 3=three, 4=four, 5=five, 6=six}
Empty TreeMap
TreeMap after: {}
Please disable your ad blocker and refresh the window to use this website.