package devmanuals.com; import java.util.*; public class RemoveElementOfTreeSet { public static void main(String[] args) { TreeSet st = new TreeSet(); st.add("Gyan"); st.add("Rohit"); st.add("Anand"); st.add("Arunesh"); System.out.println("The size of the tree set is :" + st.size()); st.clear(); System.out.println("The size of the tree set after removing is :" + st.size()); boolean bool=st.isEmpty(); System.out.println("Is the TreeSet is empty: "+bool); } }