import java.util.*; public class SortedSetExample { public static void main(String[] args) { SortedSetIn the above example, we create a SortedSet of Strings using the TreeSet class. We add some fruits to the set using the add() method and print the contents of the set. The output shows the fruits in sorted order. The package library for the java.util package is "java.util".set = new TreeSet<>(); set.add("apple"); set.add("banana"); set.add("orange"); set.add("kiwi"); set.add("mango"); System.out.println(set); // [apple, banana, kiwi, mango, orange] } }