What helped me understand variance annotation / modifiers was thinking about what type of scope (specific or broad) are being saved.

Producers

  • Uses out
  • Supertype (broad) saves subtype (specific)

Consumers

  • Uses in
  • Subtype (specific) saves supertype (broad)

This post was great, in addition to Baeldung’s guide, in order to understand the fundamentals.

--

--

Open Sourcer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store