How to Iterate Set in Java

In this tutorial, we will learn how to iterate Set in Java. Set interface does not provide any get() method like the List interface to retrieve elements. Therefore, the only way to take out elements from the set can be by using Iterator() method but this method does not return … Read more

Java HashSet | Example Program

The collections framework provides two general-purpose set implementations in Java: HashSet and TreeSet. In this tutorial, we will learn HashSet in Java with example programs in an easy way. HashSet class was introduced in Java 1.2 version and it is present in java.util.HashSet package. It internally uses HashMap to store … Read more

How to Iterate LinkedList in Java

In the last tutorial, we have discussed Java LinkedList and its various methods. In this tutorial, we will learn how to iterate LinkedList in Java. Before going on this topic, I will recommend that you first learn the basics of LinkedList in Java then come on this topic. There are … Read more

Set in Java | Set Methods, Example

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 control over where they go. For example, in many applications, … Read more

LinkedList in Java | LinkedList Methods

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

Vector Programs in Java for Best Practice

In this tutorial, we have listed various types of Vector programs in Java for practice based on Vector methods, Enumeration, Iterator, and ListIterator. Before going to practice, I will recommend going to the previous vector tutorial for clear concepts. Java Vector Program based on Enumeration Let’s create a program where … Read more

Vector in Java | Vector Methods Example

Vector in Java Vector class in Java was introduced in JDK 1.0 version. It is present in Java.util package. It is a dynamically resizable array (growable array) which means it can grow or shrink as required. Java Vector class is similar to ArrayList class with two main differences. Vector is … Read more