previous | start | next

## Wildcards

- Wildcards can be bounded in opposite direction
- `? super F` matches any supertype of `F`
- `public static <F> void append(
  ArrayList<? super F> a, ArrayList<F> b, int count)
  {
  for (int i = 0; i < count && i < b.size(); i++)
  a.add(b.get(i));
  }`
- Safe to call `ArrayList<? super F>.add`:
  `boolean add(? super F newElement)`
- Can pass any element of type `F` (but not a supertype!)

previous | start | next