Category: Java

TreeSet in java

TreeSet in Java

In the previous post, we have learnt about LinkedHashSet. In this post, we will learn about TreeSet in java. TreeSet has the following features. Contains unique elements like HashSet. The TreeSet class implements NavigableSet...

LinkedHashSet in java

LinkedHashSet in java

In the previous post, we have learnt about HashSet in java. In this post, we will see about the LinkedHashSet in java. It also implements Set interface like HashSet but it maintains insertion order. It...

HashSet in java

HashSet in java

In this previous post, we have seen how to Iterate over a Vector. In this post, we will learn about HashSet in java. HashSet has the following features. HashSet implements Set interface. It does not...

Iterate over a vector using Enumeration

Iterate over a vector using Enumeration

In the previous post, we have seen how to sort the vector. In this post, we will see how to iterate over a vector using enumeration. Create a vector and add element to it....

Sort a Vector using Collections.sort

Sort a Vector using Collections.sort()

In the previous post, we have seen how to get the sublist from vector. In this pos, we will see how to sort a vector using Collections.sort(). Vector maintains insertion order in which they...

Get Sublist from Vector

Get Sublist from Vector

In the previous post, we have seen how to remove the element from a particular position. In this post, we will see how to get sublist from vector. There is method ‘subList(int fromIndex,int toIndex)‘...

Remove element from vector

Remove element from Vector

In the previous post, we have seen how to add element at a specified index in vector. In this post, we will see how to remove element from Vector. The method which is used...

Vector in java

Add Element to Vector

In the previous post, we have seen what is Vector in java. In this post, we will see how to add element to vector. There are 3 ways, we can create vector as given...