
Java – Conversion of Arrays to HashSet
In this article, we will discuss how to convert Arrays into Set 1. Conversion of Arrays into List using asList() method : We can use Read More
In this article, we will discuss how to convert Arrays into Set 1. Conversion of Arrays into List using asList() method : We can use Read More
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
In this article, we will discuss how to sort contents of LinkedList in ascending order containing only unique elements 1. Approach : Convert LinkedList into Read More
In this article, we will discuss how to remove duplicate elements from ArrayList Q) How to convert ArrayList to HashSet ? use inter-conversion collection constructor Read More
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
In this article, we will discuss how to reverse the contents of LinkedHashSet Key points about LinkedList: LinkedHashSet maintains insertion-order It uses doubly-linked list and Read More
In this article, we will discuss various ways to iterate through HashSet – 3 ways Different ways to iterate through HashSet: Enhanced for-loop introduced in Read More
In this article, we will add one HashSet contents to another HashSet using addAll method of Collection interface 1. Adding one HashSet to another HashSet Read More
In this article, we will compare 2 HashSet contents using containsAll method of Collection interface Collection‘s containsAll() method is used to check whether one Set Read More
In this article, we will discuss an example on how to search, whether particular element present in HashSet or NOT 1. Searching element from HashSet Read More
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 collection Read More
In this article, we will discuss an example on how to delete a particular element and later deleting all elements of HashSet 1. HashSet : Read More
In this article, we will discuss how to find size or length of HashSet 1. HashSet : We can use, size() method of Collection interface to Read More
In this article, we will discuss how to convert Arrays into Vector using Arrays class’s utility asList() method Conversion of Arrays into Vector : Method Read More
In this article, we will discuss how to convert LinkedList object into a synchronized Vector object 1. Vector v/s LinkedList : Both classes implements List Read More
In this article, we will discuss how to remove duplicate elements from ArrayList maintaining its insertion-order 1. Solution: simply, convert to LinkedHashSet 2. Remove duplicate Read More
In this article, we will discuss how to perform push and pop operations with LinkedList 1. LinkedList and Deque : From Java 1.5 version, after Read More
In this article, we will discuss simple example on LinkedList specific methods i.e.; what are the various methods available in LinkedList class and how it Read More
In this article, we will discuss how to iterate through contents of LinkedList using descendingIterator() method 1. To iterate LinkedList contents in reverse-order : Method signature: Read More
In this article, we will discuss how to replace/update content of ArrayList using set method of List interface This method replaces old value with new Read More