Overview of the Java Collections Framework Hierarchy
The Java Collections Framework primarily consists of two root interfaces: Collection and Map. Since Collection extends Iterable, we can consider the framework as being built upon Iterable and Map. The Collection interface defines the contract for single-column collections that store individual elements, while the Map interface defines the contr ...
Posted on Mon, 10 Aug 2026 16:34:39 +0000 by ReKoNiZe
Understanding Iterable and Iterator in Java Collections
To enable iteration over a collection using enhanced for-loops, a class must implement the Iterable interface. This contract requires providing an Iterator instance via the iterator() method — essentially granting permission to be traversed element by element.
// Minimal Iterable interface
public interface Iterable<T> {
Iterator<T& ...
Posted on Tue, 14 Jul 2026 16:34:12 +0000 by Dragen
Understanding Array Iteration Choices in Lodash's compact Implementation
The compact functon in Lodash filters out falsy values (false, null, 0, "", undefined, NaN) from an array and returns a new array containing only truthy elements. Its implementation is minimal yet deliberate—especially in how it iterates.
Core Implementation
Here's a refactored version of the logic, preserving correctness while renami ...
Posted on Tue, 19 May 2026 18:35:20 +0000 by michaeru