Get Synchronized List from ArrayList in Java
Description
The following code shows how to get Synchronized List from ArrayList.
Example
//ww w . ja va2s . co m
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class Main {
public static void main(String[] args) {
ArrayList arrayList = new ArrayList();
List list = Collections.synchronizedList(arrayList);
}
}
The code above generates the following result.