Online Java Compiler By
JavaTpoint.com
import java.util.*; public class CollectionsUnmodifiableNavigableSetExample3 { public static void main(String[] args) { NavigableSet
set = new TreeSet<>(); Collections.addAll(set, 11, 13, 17); System.out.println("Original Set: " + set); NavigableSet
set2 = Collections.unmodifiableNavigableSet(set); set2.add(19); } }
Output