How to use iterators in Java

The iterator pattern is one of approaches to access elements of a collection, alongside with streams. From a technical point of view, the iterator traverses elements in a sequential and predictable order. In Java the behavior of iterators is defined in java.util.Iterator contract, which is a member of Java Collections Framework. Iterators are similar to […]

Read More

Understand Java Collections

When we talk about Java collections, we consider two things. First, more wide concept, means implementations of common data structures. An another, narrow understanding, corresponds to concrete interfaces and their implementations, that are contained in Java Collections Framework, supplied out-of-the box. In that sense, we need to remember that such collections inherit to the root […]

Read More