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