collections
3 articles
Java Stream API Examples, and Four Ways They Surprise You
Complete stream examples with real output — grouping, flattening, collecting to a map — plus four behaviours that cause bugs not looking like stream bugs.
JavaHashSet vs HashMap: One Is Built Out of the Other
The difference is not two designs but one — javap shows a HashSet holding a HashMap. Every behaviour, and every failure mode, follows from that.
JavaArrayList vs LinkedList: The Numbers Behind the Table
Everyone knows the complexity table. Here is what each operation actually costs when you time it — including the one result that contradicts the folklore.
Java