Java TreeSet
Set stores unique elements. HashSet — unordered, fast.
LinkedHashSet — insertion order.
TreeSet — sorted order.
Write one tiny example for TreeSet. Compile, print one result, and say the output out loud before you type.
Use TreeSet only when the problem needs it. Don’t force it into every program. Know one beginner trap.
Let's take this on the board with one tiny Main class — no extra files. Java TreeSet — duplicate A is ignored; size stays 2. Start from main, go line by line, and stop at each print. That output is the proof for TreeSet.
Pick Set type by: speed vs order vs sorted.