Set, HashSet and TreeSet


HashSet

Syntax

Set <Data type> setName = new HashSet<>();

Properties

1. There is no proper arrangement of values in this HashSet.
2. The duplicate values will be ignored/removed itself.

TreeSet

Syntax

Set <Data typesetName = new TreeSet<>();

Properties

1. The values will be arranged itself in ascending order.
Some Methods

Post a Comment

0 Comments