Wiki - README‎ > ‎Programming‎ > ‎

Java

covariance and contravariance <? extends E> <? super E> [link]

public void pushAll(Iterable<? extends E> src) {
  for (E e: src) 
    push(e);
}

public void popAll(Collection<? super E> dst) {
  while (!isEmpty())
    dst.add(pop())
}



Comments