Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Tags
#bloch-effective-java-2ed #java #java-generics
Question

// Wildcard type for parameter that serves as an E consumer - it consumes from the Stack to external collection
public void popAll(Collection<...> dst) {
  while (!isEmpty())
    dst.add(pop());
}

what kind of bounded wildcard do we need here for Collection (consumer)?
Answer
Collection<? super E>

Tags
#bloch-effective-java-2ed #java #java-generics
Question

// Wildcard type for parameter that serves as an E consumer - it consumes from the Stack to external collection
public void popAll(Collection<...> dst) {
  while (!isEmpty())
    dst.add(pop());
}

what kind of bounded wildcard do we need here for Collection (consumer)?
Answer
?

Tags
#bloch-effective-java-2ed #java #java-generics
Question

// Wildcard type for parameter that serves as an E consumer - it consumes from the Stack to external collection
public void popAll(Collection<...> dst) {
  while (!isEmpty())
    dst.add(pop());
}

what kind of bounded wildcard do we need here for Collection (consumer)?
Answer
Collection<? super E>
If you want to change selection, open document below and click on "Move attachment"

pdf

owner: piotr.wasik - (no access) - Effective Java (Joshua Bloch), 2ed, p136

Summary

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.