Are generics removed by the compiler at compile time

后端 未结 4 739
陌清茗
陌清茗 2020-12-17 21:19

In this tutorial on reflection it states:

[...] because generics are implemented via type erasure which removes all information regarding generic typ

4条回答
  •  半阙折子戏
    2020-12-17 21:46

    It means, when it is being converted into bytecode. For checking whether correct types are used or not, generics are used. But at the time of bytecode generation, information is removed

提交回复
热议问题