---
title: "Discussion on \"What is diffrence between HashSet and HashMap in java? Answer it with relevent code example.\" | Hashnode"
description: "Discussion on \"What is diffrence between HashSet and HashMap in java? Answer it with relevent code example.\". HashSet and HashMap are both data structures used in Java for storing and managing collections of elements, but they serve different purposes and have different characteristics:\n\nHashSet:\n\nHashSet is a collection that stores unique elements. It does ..."
url: "https://hashnode.com/posts/what-is-diffrence-between-hashset-and-hashmap-in-java-answer-it-with-relevent-code-example/651c55941823b9213ae9a097"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [What is diffrence between HashSet and HashMap in java? Answer it with relevent code example.](https://heerajat.hashnode.dev/what-is-diffrence-between-hashset-and-hashmap-in-java-answer-it-with-relevent-code-example?utm_source=hashnode&utm_medium=feed)

HashSet and HashMap are both data structures used in Java for storing and managing collections of elements, but they serve different purposes and have different characteristics: HashSet: HashSet is a collection that stores unique elements. It does ...

Oct 3, 2023 · 2 min read · heerajat.hashnode.dev  
Read the article

-   [#hashmap](https://hashnode.com/tag/hashmap)
-   [#hashset](https://hashnode.com/tag/hashset)
-   [#java](https://hashnode.com/tag/java)

## Written by

[Heera Jat](https://hashnode.com/@heerajat)

@heerajat · Jodhpur, India

  
[View profile](https://hashnode.com/@heerajat)

Web3 learner | Tech talk | Developer

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
