Skip to content
Courses
DSA to Development
Get IBM Certification
Newly Launched!
Master Django Framework
Become AWS Certified
For Working Professionals
Interview 101: DSA & System Design
Data Science Training Program
JAVA Backend Development (Live)
DevOps Engineering (LIVE)
Data Structures & Algorithms in Python
For Students
Placement Preparation Course
Data Science (Live)
Data Structure & Algorithm-Self Paced (C++/JAVA)
Master Competitive Programming (Live)
Full Stack Development with React & Node JS (Live)
Full Stack Development
Data Science Program
All Courses
Tutorials
Data Structures & Algorithms
ML & Data Science
Interview Corner
Programming Languages
Web Development
CS Subjects
DevOps And Linux
School Learning
Practice
Build your AI Agent
GfG 160
Problem of the Day
Practice Coding Problems
GfG SDE Sheet
Contests
Accenture Hackathon (Ending Soon!)
GfG Weekly [Rated Contest]
Job-A-Thon Hiring Challenge
All Contests and Events
DSA
Practice Problems
Python
C
C++
Java
Courses
Machine Learning
DevOps
Web Development
System Design
Aptitude
Projects
Sign In
▲
Similar Topics
DSA
22.3k+ articles
Java
10.1k+ articles
Java-Functions
4.1k+ articles
Java Programs
2.1k+ articles
Misc
2.1k+ articles
Java - util package
1.5k+ articles
Java-Collections
1.1k+ articles
Java Examples
230+ articles
HashSet
66 articles
Java-Set-Programs
23 articles
java-hashset
79 posts
Popular Articles
Recent Articles
How to Get Elements By Index from HashSet in Java?
Last Updated: 28 January 2021
HashSet extends AbstractSet and implements the Set interface. It creates a collection that uses a hash table for storage. The class does not
...read more
Java
Technical Scripter
Java-Collections
Java Programs
java-hashset
Picked
Technical Scripter 2020
How to Iterate HashSet in Java?
Last Updated: 17 September 2024
HashSet extends AbstractSet and implements the Set interface. It creates a collection that uses a hash table for storage. It stores informat
...read more
Java
Java Programs
java-hashset
Picked
Convert HashSet to a ArrayList in Java
Last Updated: 04 June 2022
ArrayList class is a resizable array, present in java.util package. The difference between an array and an ArrayList in Java, is that the si
...read more
Java
Java Programs
Java-ArrayList
java-hashset
Picked
Similar Topics
DSA
22.3k+ articles
Java
10.1k+ articles
Java-Functions
4.1k+ articles
Java Programs
2.1k+ articles
Misc
2.1k+ articles
Java - util package
1.5k+ articles
Java-Collections
1.1k+ articles
Java Examples
230+ articles
HashSet
66+ articles
Java-Set-Programs
23+ articles
How to sort HashSet in Java
Last Updated: 11 December 2018
Given a HashSet in Java, the task is to sort this HashSet.Examples:Input: HashSet: [Geeks, For, ForGeeks, GeeksforGeeks]Output: [For, ForGee
...read more
Java
Java-Collections
java-hashset
Java-Set-Programs
Difference between HashMap and HashSet
Last Updated: 06 April 2023
HashSet is an implementation of Set Interface which does not allow duplicate value. The main thing is, objects that are stored in HashSet mu
...read more
Java
Java-Collections
Difference Between
Java-HashMap
java-hashset
Java-Map-Programs
Java-Set-Programs
Hashing in Java
Last Updated: 01 March 2023
In hashing there is a hash function that maps keys to some values. But these hashing function may lead to collision that is two or more keys
...read more
Java
Hash
Java Programs
Java-HashMap
java-hashset
Java-LinkedHashMap
Java-HashTable
Java-ConcurrentHashMap
java-LinkedHashSet
DSA
Java HashSet contains() Method
Last Updated: 08 April 2025
The contains() method of the HashSet class in Java is used to check if a specific element is present in the HashSet or not. So, mainly it is
...read more
Java
Java-Collections
Java - util package
Java-Functions
java-hashset
Java HashSet add() Method
Last Updated: 20 January 2025
The HashSet add() method in Java is used to add a specific element to the set. This method will add the element only if the specified elemen
...read more
Java
Java-Collections
java-hashset
Count occurrences of elements of list in Java
Last Updated: 31 May 2022
Suppose we have an elements in ArrayList, we can count the occurrences of elements present in a number of ways.HashMapThis data structure us
...read more
Java
Java Programs
Java-HashMap
frequency-counting
java-TreeMap
java-hashset
java-list
Java-List-Programs
Java-Map-Programs
List to Set in Java
Last Updated: 11 December 2018
Given a list (ArrayList or LinkedList), convert it into a set (HashSet or TreeSet) of strings in Java.Method 1 (Simple)We simply create an
...read more
Misc
Java
Java-Collections
Java-ArrayList
java-treeset
java-hashset
java-LinkedList
java-stream
java-list
Java-Stream-programs
Java-List-Programs
Java-Set-Programs
Set to List in Java
Last Updated: 10 June 2022
Given a set (HashSet or TreeSet) of strings in Java, convert it into a list (ArrayList or LinkedList) of strings. In java, Set interface is
...read more
Misc
Java
Java-Collections
Java-ArrayList
java-treeset
java-hashset
java-LinkedList
java-stream
java-list
Java-Stream-programs
Java-List-Programs
Java-Set-Programs
Set to Array in Java
Last Updated: 29 March 2024
Given a set (HashSet or TreeSet) of strings in Java, convert it into an array of strings.Input : Set hash_Set = new HashSet(); hash_S
...read more
Misc
Java
Java-Collections
Java-Strings
Java-Arrays
java-treeset
java-hashset
java-set
Java-Array-Programs
Java-Set-Programs
Initializing HashSet in Java
Last Updated: 17 March 2022
Set in Java is an interface which extends Collection. It is an unordered collection of objects in which duplicate values cannot be stored.Ba
...read more
Java
Java-Collections
java-hashset
Java-Set-Programs
Internal working of Set/HashSet in Java
Last Updated: 11 December 2018
As we know that a set is a well-defined collection of distinct objects. Each member of a set is called an element of the set. So in other wo
...read more
Java
Java-Collections
java-hashset
Java-Set-Programs
Java HashSet
Last Updated: 12 March 2025
HashSet in Java implements the Set interface of Collections Framework. It is used to store the unique elements and it doesn't maintain any s
...read more
Java
Java-Collections
Java - util package
java-hashset
1
2
3
4
5
6
>>
Last
1
2
3
4
5
6
>>
Last
1
2
3
4
>>
Last
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !