Java tutorial
import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; public class Main { public static void main(String args[]) { List<String> arlst = new ArrayList<String>(); // populate the list arlst.add("CSS"); arlst.add("PHP"); arlst.add("HTML"); arlst.add("java2s.com"); // create typesafe view of the collection Collection<String> tslst = Collections.checkedCollection(arlst, String.class); System.out.println(tslst); } }