Home » Tag Archives: Collections (page 2)

Tag Archives: Collections

On Java Collection Waste

java-logo

This article is about overhead posed by one of the most popular frameworks used – I bet there is close to no applications where the java.util.Collections is not used. The article is based on the fact that the framework provides default values for e.g. initial size of the collections. So we had a hypothesis that most people do not bother ...

Read More »

ArrayList vs LinkedList

java-logo

I must confess the title of this post is a little bit catchy. I have recently read this blog post and this is a good summary of  discussions & debates about this subject. But this time I would like to try a different approach to compare those 2 well known data structures: using Hardware Performance Counters. I will not perform ...

Read More »

Would you dare to change HashMap implementation?

java-logo

There are bold engineers working for the Oracle nowadays. I came to this conclusion when trying to nail down a Heisenbug yesterday. Not too surprisingly, the bug seemed to disappear when I was trying to find the solution. Several hours later, the “Heisen”-part of the bug was removed, when the problem was traced down to minor differences between the JDK7 ...

Read More »

Arrays.sort versus Arrays.parallelSort

java-logo

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 static void sort(Object[] a) { if (LegacyMergeSort.userRequested) legacyMergeSort(a); else ComparableTimSort.sort(a); } This is all done sequentially, even though merge sort uses divide and ...

Read More »

Java Collections API Quirks

java-logo

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 API enhancements. But then, every once in a while, we stumble upon one of these weird quirks that originate from the depths of the JDK and its ...

Read More »

40 Java Collections Interview Questions and Answers

java-logo

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 questions and answers for java collections framework. Tip Are you looking for career opportunities in Java?   Visit our Job Board to search and review a hand-picked selection of Java jobs for IT ...

Read More »

Selecting your Collections library

java-logo

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 – no; those implementations are perfectly OK. But as always, the devil is in the details. And there exist situations when either the feature set built into the Collections API is not sufficient ...

Read More »

Type-safe Empty Collections in Java

java-logo

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, I look at the sometimes subtle but significant differences between using the relevant fields of the Collections class for accessing an empty collection versus using the relevant methods of the Collections class for ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close