package codeurjava. Древовидная карта;Runtime:
import java.util.TreeMap;
public class TreeMapCopy {
public static void main(String a[]){
TreeMaphmap = new TreeMap ();
//добавляем ключ-значение peers
hmap.put(1, "один");
hmap.put(2, "два");
hmap.put(3,"три");
hmap.put(4,"четыре");
hmap.put(5,"пять");
hmap.put(6,"six");
System.out.println("TreeMap before: "+hmap);
System.out.println("Empty TreeMap");
hmap.clear();
System.out.println("TreeMap после: "+hmap);
}
}
TreeMap before: {1=один, 2=два, 3=три, 4=четыре, 5=пять, 6=шесть}
пустой TreeMap
TreeMap после: {}
Please disable your ad blocker and refresh the window to use this website.