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