OnJava8-Examples/generics/NonCovariantGenerics.java

10 lines
269 B
Java
Raw Normal View History

2015-04-20 15:36:01 -07:00
//: generics/NonCovariantGenerics.java
2015-05-29 14:18:51 -07:00
// <20>2015 MindView LLC: see Copyright.txt
2015-04-20 15:36:01 -07:00
// {CompileTimeError} (Won't compile)
import java.util.*;
public class NonCovariantGenerics {
// Compile Error: incompatible types:
2015-05-18 23:05:20 -07:00
List<Fruit> flist = new ArrayList<Apple>();
2015-04-20 15:36:01 -07:00
} ///:~