This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class TypeSafety { | |
public static void main(String[] args){ | |
List<Set<?>> listOfWildcardSet = new ArrayList<Set<?>>(); | |
listOfWildcardSet.add(new HashSet<String>()); | |
listOfWildcardSet.add(new HashSet<Integer>()); | |
listOfWildcardSet.set(0, listOfWildcardSet.get(0)); | |
listOfWildcardSet.set(1, listOfWildcardSet.get(1)); |