Online Java Compiler By
JavaTpoint.com
import java.util.*; public class CollectionsCheckedListExample3 { public static void main(String[] args) { //Create list ArrayList
arrlist = new ArrayList
(); arrlist.add(10); arrlist.add(20); arrlist.add(30); arrlist.add(40); //Create type safe view of the collection Collection
tsafelist; tsafelist = Collections.checkedList(arrlist,Integer.class); System.out.println("Type safe view of the List is: "+tsafelist); } }
Output