How to remove elements while iterating collection object

October 16, 2016

In this article, we will discuss how to remove elements from ArrayList while iterating Collections objects using Iterator interface Note: ConcurrentModificationException will be thrown when Read More

How to get minimum element from ArrayList

October 15, 2016

In this article, we will discuss how to get minimum element from ArrayList using Collections class’s utility min() method   To get minimum element from Read More

How to get maximum element from ArrayList

October 14, 2016

In this article, we will discuss how to get maximum element from ArrayList using Collections class’s utility max() method   To get maximum element from Read More

Converting Ordered ArrayList into Sorted TreeSet

October 14, 2016

In this article, we will discuss how to convert Ordered ArrayList into Sorted TreeSet We can sort ArrayList in both ascending and descending order, by Read More

Sorting HashSet contents in ascending and descending order

October 14, 2016

In this article, we will discuss how to sort HashSet contents in ascending as well as descending order Solution: Ascending order: by passing HashSet contents as Read More

Conversion of Arrays to HashSet

October 13, 2016

In this article, we will discuss how to convert Arrays into Set   Conversion of Arrays into List using asList() method : We can use Read More

Conversion of HashSet to Arrays

October 13, 2016

In this article, we will discuss how to convert HashSet into Arrays using Collection’s toArray() method   Conversion of HashSet into Arrays using toArrays() method Read More

How to convert LinkedList to contain unique elements in ascending order

October 13, 2016

In this article, we will discuss how to sort contents of LinkedList in ascending order containing only unique elements   Approach : convert to TreeSet Read More

Conversion of ArrayList into HashSet to remove duplicate elements

October 12, 2016

In this article, we will discuss how to remove duplicate elements from ArrayList   How to convert ArrayList to HashSet ? use inter-conversion collection constructor Read More

Various ways to iterate through Vector – 5 ways

October 12, 2016

In this article, we will discuss various ways to iterate through Vector objects Various ways to iterate through Vector: regular for-loop Enhanced for-loop introduced in Read More

October 12, 2016

Various ways to iterate through HashSet – 3 ways

October 11, 2016

In this article, we will discuss various ways to iterate through HashSet – 3 ways Various ways to iterate through HashSet: Enhanced for-loop introduced in Read More

October 11, 2016

Comparing two HashSet objects using containsAll() method

October 11, 2016

In this article, we will compare 2 HashSet contents using containsAll method of Collection interface This Collection method is used to check whether one Set Read More

How to check whether particular element is present in HashSet

October 10, 2016

In this article, we will discuss an example on how to search, whether particular element present in HashSet or NOT   Searching element from HashSet Read More

retainAll() method explanation with HashSet

October 10, 2016

In this article, we will discuss retainAll() method of Collection interface with HashSet   boolean retainAll(Collection c); remove/deletes all element/objects of invoking collection except specified Read More

How to delete an element and delete all elements of HashSet

October 10, 2016

In this article, we will discuss an example of HashSet on how to delete a particular element and later deleting all elements   HashSet : Read More

How to get size or length of HashSet

October 9, 2016

In this article, we will discuss how to find size or length of HashSet   HashSet : We can use, size() method of Collection interface to Read More

Conversion of Arrays to Vector

October 8, 2016

In this article, we will discuss how to convert Arrays into Vector using Arrays class’s utility asList() method   Conversion of Arrays into Vector : Read More