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

  • Uses out
  • Supertype (broad) saves subtype (specific)
  • 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

Love podcasts or audiobooks? Learn on the go with our new app.

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