且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

具有自动装箱和取消装箱的泛型

更新时间:2023-09-18 09:25:28

不应将泛型与原始类型一起使用. T表示应作为对象的类型参数.
更多参考
为什么Java泛型不支持原始类型? Java泛型? ,E和T有什么区别?
泛型限制

Generics are not supposed to be used with primitive types. T indicates a type parameter which should be an object.
More reference
Why don't Java Generics support primitive types? Java Generics ? , E and T what is the difference?
Restrictions on generics