OnJava8-Examples/generics/SuperTypeWildcards.java
2015-05-29 14:18:51 -07:00

12 lines
299 B
Java

//: generics/SuperTypeWildcards.java
// ©2015 MindView LLC: see Copyright.txt
import java.util.*;
public class SuperTypeWildcards {
static void writeTo(List<? super Apple> apples) {
apples.add(new Apple());
apples.add(new Jonathan());
// apples.add(new Fruit()); // Error
}
} ///:~