Category Java

How to Iterate Set in Java

Ways to iterate set in Java

In this tutorial, we will learn how to iterate Set in Java with the help of examples. A set is a collection of unique elements or objects that are not stored in a particular order. Set interface does not provide…

HashSet in Java

Java HashSet hierarchy diagram

HashSet in Java is an unordered collection of elements (objects) that contains only unique elements. That is, it allows duplicate free elements to be stored. It internally uses Hashtable data structure to store a set of unique elements. It is…

How to Iterate LinkedList in Java

Five ways to iterate LinkedList in Java

In Java, LinkedList is a popular data structure that is an implementation of the List interface, meaning that it supports all the operations defined in the List interface, such as add, remove, and get. We frequently use it to store…

Set in Java

Realtime example of set in Java

A set in Java is an unordered collection of unique elements or objects. In other words, a set is a collection of elements that are not stored in a particular order. Elements are simply added to the set without any…

LinkedList in Java

LinkedList in Java

➲ LinkedList in Java is a linear data structure that uses a doubly linked list internally to store a group of elements. A doubly linked list consists of a group of nodes that together represents a sequence in the list.…