Online Java Compiler By
JavaTpoint.com
import java.util.*; public class CollectionsCheckedNavigableSetExample1 { public static void main(String[] args) { NavigableSet
set = new TreeSet<>(); //Insert values in the Map set.add("A1"); set.add("B2"); set.add("C3"); set.add("D4"); //Create type safe view of the Set System.out.println("Type safe view of the Navigable Set is: "+Collections.checkedNavigableSet(set,String.class)); } }
Output