0 votes
in JAVA by
How HashSet works internally in Java?

1 Answer

0 votes
by

HashSet is internally implemented using an HashMap. Since a Map needs key and value, a default value is used for all keys. Similar to HashMap, HashSet doesn't allow duplicate keys and only one null key, I mean you can only store one null object in HashSet.

Related questions

0 votes
asked Nov 21, 2023 in Jupyter by sharadyadav1986
0 votes
asked Feb 12, 2020 in JAVA by rahuljain1
...