OnJava8-Examples/generics/NonCovariantGenerics.java

10 lines
262 B
Java
Raw Normal View History

2015-09-07 11:44:36 -06:00
// generics/NonCovariantGenerics.java
2015-06-15 17:47:35 -07:00
// <20>2015 MindView LLC: see Copyright.txt
// {CompileTimeError} (Won't compile)
import java.util.*;
public class NonCovariantGenerics {
// Compile Error: incompatible types:
List<Fruit> flist = new ArrayList<Apple>();
2015-09-07 11:44:36 -06:00
}