List and Set inherit from Collection, but Map does not inherit from Collection. List includes ArrayList and Vector. Stack inherit from Vector Set includes Treeset, HashSet, LinkedHashSet, LinkedHashSet inherited HashSet The Map including TreeMap, HashMap, LinkedHashMap (inherited a HashMap), WeakHashMap, IdentityHashMap, Where,WeakHashMap and IdentityHashMap do not inherit Hashmap, but AbstractMap, and implement Map interface, the same as Hashmap (this is similar to).




















In this case, it is: Execute the Sub method, then execute the static method of the Base class of Sub (none), then execute the static method of Sub (none), then execute the non-static block of the parent class (none), then execute the constructor of the parent class (there is a callName method in it because the callName square is override in Sub) Subclass baseName = baseName; subclass baseName = baseName; subclass baseName = baseName; subclass baseName = baseName Basename =”basename”, so basename remains null and the value of null is printed


































The common HashSet in Set, and the linkedHashset integrated with HashSet, are not synchronized in Set, and the uncommon TreeSet is also not synchronized

Common HashMap Map, linkedhashmap, the Map is out of sync, unusual TreeMap, WeakHashMap, IdentityHashMap is out of sync

Summary, common linkedlist, arraylist, hashset, linkedhashset, hashmap, common set of linkedhashmap are out of sync, the map is not synchronized, only the vector in the list is synchronized Only vector and the stack that inherits from vector are synchronized

A StringBuffer is synchronous, and a StringBuilder is not. HashMap is not synchronous, but Hashtable is synchronous. Properties inheritance is also synchronized with Hashtable,Properties