HashSet: Stores unique elements without guaranteeing iteration order.TreeSet: Stores unique elements in sorted order.