List/Grid Tag Archives: Collections

Arrays.sort versus Arrays.parallelSort
We all have used Arrays.sort to sort objects and primitive arrays. This API used merge sort OR Tim Sort underneath to sort the contents as shown below: public ...

Java Collections API Quirks
So we tend to think we’ve seen it all, when it comes to the Java Collections API. We know our ways around Lists, Sets, Maps, Iterables, Iterators. We’re ready for Java 8?s Collections ...

40 Java Collections Interview Questions and Answers
Java Collections Framework are the fundamental aspect of java programming language. It’s one of the important topic for java interview questions. Here I am listing some important ...

Selecting your Collections library
Is this really something you should bother? Is there something fundamentally wrong with java.util.ArrayList and java.util.HashMap? For most of the source code out there the answer is ...

Type-safe Empty Collections in Java
I have blogged before on the utility of the Java Collections class and have specifically blogged on Using Collections Methods emptyList(), emptyMap(), and emptySet(). In this post, ...

Java: Choosing the right Collection
Here is a quick guide for selecting the proper implementation of a Set , List , or Map in your application. The best general purpose or ‘primary’ ...

Java 7: HashMap vs ConcurrentHashMap
As you may have seen from my past performance related articles and HashMap case studies, Java thread safety problems can bring down your Java EE application and the Java EE container ...

Five useful ways to sorting in java
A rapid overview of java sorting : normal sort of list : private static List VEGETABLES = Arrays.asList("apple", ...

Array, list, set, map, tuple, record literals in Java
Occasionally, when I’m thrilled by the power and expressiveness of JavaScript, I find myself missing one or two features in the Java world. Apart from lambda expressions / closures ...

Common and Unique Elements In Multiple Collections
This week, we’ll take a break from higher level problems and technology posts to deal with just a little code problem that a lot of us have probably faced. It’s nothing fancy or ...

