Collections
-
Core Java
How to Use Java 8 Streams to Swiftly Replace Elements in a List
Imagine you have a list of items: List<String> books = Arrays.asList( "The Holy Cow: The Bovine Testament", "True Hip Hop",…
Read More » -
Core Java
Transforming Collections with Decorators
The Decorator Pattern Ever since first learning the programming design patterns, the decorator pattern has been my favorite. It seemed…
Read More » -
Core Java
Stream-Powered Collections Functionality in JDK 8
This post presents application of JDK 8 – introduced Streams with Collections to more concisely accomplish commonly desired Collections-related functionality.…
Read More » -
Core Java
How to use CopyOnWriteArraySet in Java with Example
CopyOnWriteArraySet is little brother of CopyOnWriteArrayList class. These are special purpose collection classes which was added on JDK 1.5, along…
Read More » -
Core Java
Code4ReferenceList Recently Used(LRU) implementation using LinkedHashMap
Recently I stumbled on one of the Java interview questions: “Implement List-Recently-Used (LRU) Cache using Java collection class?” If you…
Read More » -
Core Java
HashMap performance improvements in Java 8
HashMap<K, V> is fast, versatile and ubiquitous data structure in every Java program. First some basics. As you probably know,…
Read More » -
Core Java
Oracle Drops Collection Literals in JDK 8
In a posting on the OpenJDK JEP 186 Oracle’s Brian Goetz informs that Oracle will not be pursuing collection literals…
Read More » -
Core Java
How HashMap works in java
Most common interview questions are “How HashMap works in java”, “How get and put method of HashMap work internally”. Here…
Read More » -
Core Java
Java, Scala, Guava and Trove Collections – How Much Data Can They Hold?
One of the fascinating things about our data structures is that even though we’re so familiar with them, it’s still…
Read More »