Why should I care that Java doesn't have reified generics?

后端 未结 13 791
予麋鹿
予麋鹿 2020-11-28 02:59

This came up as a question I asked in an interview recently as something the candidate wished to see added to the Java language. It\'s commonly-identified as a pain that Jav

13条回答
  •  庸人自扰
    2020-11-28 03:20

    It's not that you will achieve anything extraordinary. It will just be simpler to understand. Type erasure seems like a hard time for beginners, and it ultimately requires one's understanding on the way the compiler works.

    My opinion is, that generics are simply an extra that saves a lot of redundant casting.

提交回复
热议问题