Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

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