Home » Tag Archives: Collections (page 2)

Tag Archives: Collections

Oracle Drops Collection Literals in JDK 8

java-logo

In a posting on the OpenJDK JEP 186 Oracle’s Brian Goetz informs that Oracle will not be pursuing collection literals as a language feature in JDK8. A collection literal is a syntactic expression form that evaluates to an aggregate type as an array, List or Map. Project Coin proposed collection literals, which also complements the library additions in Java SE8. ...

Read More »

How HashMap works in java

java-logo

Most common interview questions are “How HashMap works in java”, “How get and put method of HashMap work internally”. Here I am trying to explain internal functionality with an easy example. Rather than going through theory, we will start with example first, so that you will get better understanding and then we will see how get and put function work ...

Read More »

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 »
Want to take your Java Skills to the next level?
Grab our programming books for FREE!
  • Save time by leveraging our field-tested solutions to common problems.
  • The books cover a wide range of topics, from JPA and JUnit, to JMeter and Android.
  • Each book comes as a standalone guide (with source code provided), so that you use it as reference.
Last Step ...

Where should we send the free eBooks?

Good Work!
To download the books, please verify your email address by following the instructions found on the email we just sent you.