Archive of stories published by omni:us

Wildcards in Java generics (Part 1/3)

Covariance: Why List<Cat> is not assignable to List<Animal>?

I often find myself trying to assign a lists of cats (List<Cat>) to a list of animals (List<Animal>). This is not possible in java and it led me down a rabbit hole of reading…

These were the top 10 stories published by omni:us; you can also dive into yearly archives: 2017, 2018, 2019, 2020, and 2021.