我的github

泛型,作为JDK5时代引入的”语法糖“,在编译的时候是会被抹除的,换言之,specialSort(List<Dog>)specialSort(List<Apple>)在编译时都会变成specialSort(List),因此不符合重载的原则(变量名相同、参数类型或数量不同)。

参考:https://blog.csdn.net/m0_37676618/article/details/106714182

参考2:https://zhuanlan.zhihu.com/p/131602691

参考3:https://stackoverflow.com/questions/72926723/both-methods-have-same-erasure-yet-neither-overrides-the-other

MarkupContainer中的setDefaultModel函数:

IGenericComponent中的setDefaultModel函数:略

 

posted on 2024-02-12 14:34  XiaoNiuFeiTian  阅读(254)  评论(0编辑  收藏  举报