Wednesday, September 30, 2026

Top 5 Udemy Courses to Learn Java Collections and Stream API in 2027 - Best of Lot

Hello guys, If you have been programming in Java, then you know that Collections and Streams are two of the most important Java APIs. There is hardly any Java program I have written in my 15 years of professional Java development career where I have not used any classes from Collections and recently from Stream API. I strongly believe that every Java developer should have a good knowledge of both of them, and that's why I am writing this post. If you are new to Java, then you might be thinking about why they are so important? Well, they are important becuase they deal with data, and data is at the heart of every application and business. For example, if you create an application like Facebook, then where do you store your Users on memory?

Saturday, July 19, 2025

What is PriorityQueue or priority queue in Java with Example - Tutorial

PriorityQueue is an unbounded Queue implementation in Java, which is based on a priority heap. PriorityQueue allows you to keep elements in a particular order, according to their natural order or custom order defined by the Comparator interface in Java. Head of priority queue data structure will always contain the least element with respect to specified ordering. For example, in this post, we will create a PriorityQueue of Items, which are ordered based upon their price, this will allow us to process Items, starting from the lowest price. A priority queue is also very useful in implementing the Dijkstra algorithm in Java. You can use to PriorityQueue to keep unsettled nodes for processing.

What is EnumMap in Java – Example Tutorial

What is EnumMap in Java
EnumMap in Java is added on JDK  5 release along with other important features like  Autoboxing, varargs, and Generics. EnumMap is a specialized Map implementation designed and optimized for using Java Enum as key. Since enum can represent a type (like class or interface)  in Java and it can also override equals() and hashCode(), It can be used inside HashMap or any other collection but using  EnumMap brings implementation-specific benefits which are done for enum keys, In short EnumMap is optimized Map implementation exclusively for enum keys. As per Javadoc Enum is implemented using Arrays and common operations result in constant time.