import java.util.Iterator;
import java.util.TreeSet;
import java.util.Set;
import javax.management.monitor.StringMonitor;
public class TreeSetToHashCode {
public static void main(String[] args) {
// creating our TreeSet
Set<String> ts = new TreeSet<>();
// adding element to our set
// insertion order is maintained here
ts.add("Neha");
ts.add("Nisha");
ts.add("Nishu");
ts.add("Rekha");
ts.add("Madhu");
ts.add("Disha");
ts.add("Tara");
ts.add("Tara"); // duplicate element can't be added
System.out.println(ts.hashCode());
}
}