Main-Quiz-solution2.java 314 B

12345678910111213
  1. import java.util.LinkedList;
  2. public class Main {
  3. public static void main(String[] args) {
  4. LinkedList<? extends Fruit> apples = new LinkedList<Apple>();
  5. // I can't get apples in
  6. // this gives an error
  7. apples.add(new Apple());
  8. // In fact, you can only add null!
  9. }
  10. }