See More

import java.util.*; public class SetTest { public static void main(String[] args) { HashMap hashMap = new HashMap<>(); hashMap.put("a","1"); hashMap.put("b","2"); TreeMap treeMap = new TreeMap<>(); treeMap.put("a","1"); treeMap.put("b","2"); System.out.println(hashMap); System.out.println(treeMap); HashSet hashSet = new HashSet<>(); hashSet.add("a"); hashSet.add("b"); TreeSet treeSet = new TreeSet<>(); treeSet.add("a"); treeSet.add("b"); Hashtable hashtable=new Hashtable<>(); } }