Online Java Compiler By
JavaTpoint.com
import java.util.*; public class CollectionsSynchronizedCollectionExample1 { public static void main(String[] args) { //Create vector object Vector
vector = new Vector
(); //Add values in the vector vector.add("A"); vector.add("B"); vector.add("C"); vector.add("D"); vector.add("E"); //Create a synchronized view Collection
coll = Collections.synchronizedCollection(vector); System.out.println("Synchronized view is :"+coll); } }
Output