Intuitively explain why `List` is covariant but `Array` is invariant?

后端 未结 0 1755
盖世英雄少女心
盖世英雄少女心 2020-12-07 22:25

From List[+T] I understand a list of dogs is also a list of animals which aligns perfectly with the intuition. From def :: [B >: A](elem: B): List[B]

相关标签:
回答
  • 消灭零回复
提交回复
热议问题