JDK
Java · 28 notes
- Cloneable and Object.clonehistorical
1. What the Cloneable interface is. 2. What object cloning is. 3. How to implement object cloning: shallow cloning and deep cloning. 4. References.
- 5.2 Integerhistorical
Usage and implementation analysis of Integer, including immutability, valueOf, IntegerCache, and autoboxing behavior.
- 5.3 ArrayListhistorical
What ArrayList is, how to use it, and source analysis of construction, add, remove, resizing, and fail-fast behavior.
- 5.4 Hashtablehistorical
What Hashtable is, how to use it, and source analysis of construction, synchronized put/get/remove/containsKey, hashing, chaining, and rehashing.
- Objecthistorical
Methods on Object, the equals/hashCode contract, and the difference between wait and sleep.
- PriorityQueuehistorical
1. What PriorityQueue is. 2. Usage. 3. Source analysis: fields, constructors, heapify, insertion, deletion, sift-up, and sift-down. 4. Reference.
- 5.7 Serializablehistorical
Serialization and deserialization in Java, custom readObject/writeObject hooks, implementation flow, serialVersionUID, and serialization algorithm.
- Stringhistorical
1. What String is. 2. Usage. 3. Source analysis: class definition, constructors, constant pool, equals, toCharArray, toString, valueOf, intern, and substring. 4. Common questions. 5. References.
- 5.10 LinkedListhistorical
What LinkedList is, usage, and source analysis of its doubly linked list, add/remove operations, and node traversal.
- LinkedHashMaphistorical
What LinkedHashMap is, insertion-order and access-order usage, and source analysis of construction, put, get, contains, remove, and iteration.
- StringBufferhistorical
1. What It Is: a thread-safe mutable string, essentially StringBuilder with synchronized methods. 2. Usage. 3. Implementation analysis: constructor, append, toString, and substring.
- Java Map Implementations Comparedhistorical
Comparison of HashMap 1.7 and 1.8, HashMap and Hashtable, and TreeMap, LinkedHashMap, and HashMap.
- Collections.synchronizedSethistorical
Synchronized Set wrappers and the need for external synchronization during compound operations and iteration.
- StringBuilderhistorical
1. What It Is: a mutable, thread-unsafe string. 2. Usage. 3. Implementation analysis: constructor, append, toString, and substring.
- List Comparisonhistorical
Comparison of ArrayList and LinkedList, Vector and ArrayList, and SynchronizedList and Vector.
- Collections.synchronizedMaphistorical
Synchronized Map wrappers, compound-operation atomicity, iteration locking, and concurrent alternatives.
- Collections.synchronizedListhistorical
1. What It Is: a thread-safe list. 2. Usage. 3. Source analysis: synchronizedList, SynchronizedList construction, mutex initialization, and synchronized method delegation.
- 5.24 TreeMaphistorical
What TreeMap is, usage, and source analysis of constructors, put, get, containsKey, and remove.
- 5.25 Vectorhistorical
What Vector is, usage, source analysis, synchronization, and thread-safety limitations of compound operations.
- 5.26 fail-fasthistorical
fail-fast and fail-safe, Java iterator design, examples, implementation analysis, and summary.
- HashMap in JDK 7historical
1. Questions: hand-written HashMap, why capacity is converted to a power of 2, resizing, hash collisions, head insertion, concurrent resize loops, null keys, and ConcurrentModificationException. 2. References.
- HashMap in JDK 8historical
What HashMap is, usage, source analysis of construction, put, resize, treeification, get, containsKey, remove, containsValue, and differences from JDK 7.