Open In App

HashSet In Scala

HashSet is sealed class. It extends immutable Set and AbstractSet trait. Hash code is used to store elements. It neither sorts the elements nor maintains insertion order . The Set interface implemented by the HashSet class, backed by a hash table . In Scala, A concrete implementation of Set semantics is known HashSet.
Syntax:

var HashsetName = HashSet(element1, element2, element3, ....)  

Operations perform with HashSet


Article Tags :