Quantcast
Channel: HowToDoInJava
Browsing latest articles
Browse All 22 View Live

Create List with Single Element

Learn to create List instances with only one element in it using Arrays.asList() and Collections.singletonList() methods. Using Collections.singletonList() Method [ Immutable List ] This is simplest...

View Article



Popular HashMap and ConcurrentHashMap Interview Questions

In my previous post related to “How HashMap works in java“, I explained the internals of HashMap class and how they fit into whole concept. But when interviewer ask you about HashMap related concepts,...

View Article

Top Java Collection Interview Questions

Without argument, java collections is one of the most important area where you will be tested in any position whether junior or senior. The scope is so much wide, that its almost impossible to cover...

View Article

Java Iterate List Examples

To iterate list in java is very basic operation, but over the years it’s gone through some significant changes. We will go through all these changes in given examples. The post Java Iterate List...

View Article

How HashMap works in Java

Learn how hashmap works internally in java with example. Learn the hashmap internal implementation analysis, collision resolution and Java 8 hashmap update. The post How HashMap works in Java appeared...

View Article


Java TreeMap class

TreeMap in Java is used to store key-value pairs very similar to HashMap class. Difference is that TreeMap provides an efficient way to store key/value pairs in sorted order. It is a red-Black tree...

View Article

Java Spliterator interface

Java Spliterator interface is an internal iterator that breaks the stream into the smaller parts. These smaller parts can be processed in parallel. In real life programming, we may never need to use...

View Article

Java PriorityQueue class

Java PriorityQueue example. PriorityQueue class is a queue data structure implementation in which objects are processed based on their priority. The post Java PriorityQueue class appeared first on...

View Article


Java PriorityBlockingQueue class

Java PriorityBlockingQueue class is concurrent blocking queue data structure implementation in which objects are processed based on their priority. The “blocking” part of the name is added to imply the...

View Article


Java ArrayBlockingQueue class

ArrayBlockingQueue class is Java concurrent and bounded blocking queue implementation backed by an array. It orders elements FIFO (first-in-first-out). The head of the ArrayBlockingQueue is that...

View Article

Java TransferQueue – Java LinkedTransferQueue class

Java TransferQueue is a concurrent blocking queue implementation in which producers may wait for receipt of messages by consumers. LinkedTransferQueue class is an implementation of TransferQueue in...

View Article

Java CopyOnWriteArrayList class

Java CopyOnWriteArrayList is a thread-safe variant of ArrayList in which all mutative operations (add, set, and so on) are implemented by making a fresh copy of the underlying array. It’s immutable...

View Article

Java CopyOnWriteArraySet class

Java CopyOnWriteArraySet example. This class is a thread-safe variant of HashSet which uses a underlying CopyOnWriteArrayList for all of its operations. The post Java CopyOnWriteArraySet class appeared...

View Article

Browsing latest articles
Browse All 22 View Live




Latest Images