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 producer - produces Es onto a Stack from external Iterable
public void pushAll(Iterable<...> src) {
  for (E e : src)
    push(e);
}

what kind of bounded wildcard do we need here for Iterable (producer)?
Answer
Iterable<? extends E>

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

// Wildcard type for parameter that serves as an E producer - produces Es onto a Stack from external Iterable
public void pushAll(Iterable<...> src) {
  for (E e : src)
    push(e);
}

what kind of bounded wildcard do we need here for Iterable (producer)?
Answer
?

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

// Wildcard type for parameter that serves as an E producer - produces Es onto a Stack from external Iterable
public void pushAll(Iterable<...> src) {
  for (E e : src)
    push(e);
}

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

pdfs

  • owner: piotr.wasik - (no access) - Effective Java (Joshua Bloch), 2ed, p135
  • owner: Jack-Rustier - (no access) - Joshua Bloch-Effective Java-Addison-Wesley (2017).pdf, p161

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.