Online Java Compiler By
JavaTpoint.com
import java.util.*; public class CollectionsUnmodifiableCollectionExample2 { public static void main(String[] args) { Collection
c = new ArrayList<>(); Collections.addAll(c, "Google", "Mozila FireFox", "Yahoo"); System.out.println("Initial Collection: "+ c); Collection
c2 = Collections.unmodifiableCollection(c); c2.add("Safari"); } }
Output