1. Hashmap and Hashtable difference:
HashMap allows keys and values are null, the key or value is allowed Hashtable null.
Hashtable is synchronized, whereas HashMap is not. HashMap is more suitable for single-threaded environment, while Hashtable suitable for multi-threaded environment.
2. Java garbage collection:
The same time, the CPU can only handle one thread, only one thread at work (execution), and multi-threaded full use of resources.
Open thread 4 ways, inheritance Thred, implement Runnable, implement Callble interfaces and use the thread pool.
Life Cycle -> New -> Ready -> obstruction -> Run -> death , obstruction to run the process is mainly to see the thread loop.
5. What are set:
List: orderly, repeatable
set: random, non-repeatable
map: with key-value pairs stored