JDK
Java · 28 notes
- Cloneable and Object.clonehistorical
Cloneable and Object.clone: It is a marker interface. An object that implements this interface can call Object.clone to copy the current object. What is copied here is the object's fields.
- 5.2 Integerhistorical
Integer is immutable. These notes examine its structure and wrapper-type behavior through implementation details such as its final class.
- 5.3 ArrayListhistorical
ArrayList is a resizable array-backed list that preserves order and allows duplicates. These notes trace its implementation through class relationships and the backing array.
- 5.4 Hashtablehistorical
Hashtable provides thread-safe key-value storage, implements Map, and supports cloning and serialization. These notes examine operations through class relationships.
- Objecthistorical
Object provides basic methods such as getClass, hashCode, and equals. These notes connect them with runtime types and hash-container usage.
- PriorityQueuehistorical
PriorityQueue orders elements by priority rather than insertion order alone. These notes examine ordering rules and internal operations through examples.
- 5.7 Serializablehistorical
Serialization stores or transmits memory objects, while deserialization restores them. These notes examine Serializable and its read and write methods.
- 5.8 HashSethistorical
HashSet uses HashMap to store distinct elements. These notes examine set operations and source code through its structure.
- Stringhistorical
String represents immutable strings that can be shared across threads. These notes examine the implementation of immutability and related operations.
- 5.10 LinkedListhistorical
LinkedList is a doubly linked list that preserves order, allows duplicates, and supports deque operations. These notes examine its structure and operations.
- LinkedHashMaphistorical
LinkedHashMap uses a doubly linked list to maintain order on top of HashMap. These notes compare their structures and trace operations.
- Immutable Objecthistorical
Immutable objects do not change state after construction. These notes examine constraints such as final classes and fields when constructing them.
- LinkedHashSethistorical
LinkedHashSet organizes data with LinkedHashMap and uses a placeholder value. These notes examine how that relationship supports set operations.
- StringBufferhistorical
StringBuffer provides thread-safe mutable-string operations through synchronization. These notes compare it with StringBuilder.
- Converting Between List and Arrayhistorical
Arrays and lists often need conversion. These notes use code examples to record conversions in both directions and their behavioral differences.
- Java Map Implementations Comparedhistorical
HashMap implementations differ between JDK 1.7 and 1.8. These notes compare collision handling, tree conversion, and concurrent resizing.
- Collections.synchronizedSethistorical
SynchronizedSet wraps set operations with synchronized protection. These notes connect its wrapper with the implementations of synchronized collections.
- StringBuilderhistorical
StringBuilder stores characters in a resizable array and supports mutation without thread-safety guarantees. These notes trace append and resize operations.
- List Comparisonhistorical
ArrayList and LinkedList use different underlying structures. A comparison table examines access, insertion, deletion, and related operations.
- Collections.synchronizedMaphistorical
SynchronizedMap wraps map operations in synchronization blocks. These notes connect it with SynchronizedList to examine synchronized wrappers.
- TreeSethistorical
TreeSet uses TreeMap to store distinct elements. These notes examine insertion, lookup, and iteration through the underlying method calls.
- String Comparisonhistorical
String is immutable, while StringBuilder and StringBuffer are mutable. A comparison table examines thread safety and usage scenarios.
- Collections.synchronizedListhistorical
SynchronizedList adds synchronization around list operations. These notes cover its wrapper and source code through the need for thread safety.
- 5.24 TreeMaphistorical
TreeMap stores key-value pairs in a red-black tree with O(log N) basic operations. These notes examine key ordering and iteration.
- 5.25 Vectorhistorical
Vector is a thread-safe list with indexed access, cloning, and serialization. These notes examine usage and implementation through its class relationships.
- 5.26 fail-fasthistorical
Fail-fast stops immediately on an error, while fail-safe allows continued operation in some cases. These notes connect that distinction with collection iteration.
- HashMap in JDK 7historical
JDK 1.7 HashMap derives bucket indexes from hashes and array length, then handles collisions with linked lists. These notes trace the related methods.
- HashMap in JDK 8historical
JDK 1.8 HashMap organizes key-value data with arrays, linked lists, and red-black trees. These notes trace its implementation through access behavior and class relationships.