[問題] 請問covariant是什麼意思?
The problem is that arrays are covariant, so a List<String>[] is also an
Object[], and you can use this to assign an ArrayList<Integer> into your
array, with no error at either compile time or run time.
雖然這句話我大概了解是什麼意思,
不過不非常清楚covarint是泛指什麼意思,
是後半段,is-a 又為is-b的關係就是covarint的意思嗎?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 210.241.106.154
※ 編輯: rick1014 來自: 210.241.106.154 (04/02 16:22)
推
04/02 16:43, , 1F
04/02 16:43, 1F
※ 編輯: rick1014 來自: 210.241.106.154 (04/02 17:07)
推
04/03 01:13, , 2F
04/03 01:13, 2F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):