Suppose you have a Map or Dictionaries like HashMap or Hashtable, which contains key-value pairs like books and their prices, and you want to delete …
One of the common problem while removing elements from an ArrayList in Java is the ConcurrentModificationException. If you use classical for loop wit…
Hello guys, today, I am going to share with you a useful tip to initialize a List like ArrayList or LinkedList with values, which will help you a lot…
The ConcurrentHashMap class part of concurrent collections package added on JDK 1.5 which contains utility classes likeBlockingQueue, CopyOnWriteArra…
Hello guys, this is my first article in Java 9 features on this blog and today you'll learn about my favorite feature "factory methods for c…
Until JDK 8, there was no way to create a large, thread-safe, ConcurrentHashSet in Java. The java.util.concurrent package doesn't even have a cla…
In the last article, I have shown you how to sort a Map in Java 8 by keys and today, I'll teach you how to sort a Map by values using Java 8 fea…
In the last article, I have shown how to remove key/value pairs from a map in Java based upon some conditions like remove all entries where values ar…
Hello guys, If you are preparing for Java interviews then you may know that Java Generics and Collections are two of the most important topics, parti…
ArrayList and Vector are two of most used class on java collection package and difference between Vector and ArrayListis one of the most frequently a…
What is EnumMap in Java EnumMap in Java is added on JDK  5 release along with other important features like Autoboxing, varargs, and Generics. Enum…