For the trouble, you get rock-solid performance, compile-time type checking, and a very high-level language.
虽然付出了这一点成本,但可以得到非常好的性能,编译时类型检查,以及一个非常高级的语言。
Generics are useful because they provide stronger compile-time type checking, require fewer explicit conversions between data types, and reduce the need for boxing operations and run-time type checks.
泛型相当有用,因为他们提供强制的编译时类型检查,要求更少的数据类型之间的显式转换,并减少装箱拆箱的操作和运行时类型检查。
Generics are useful because they provide stronger compile-time type checking, require fewer explicit conversions between data types, and reduce the need for boxing operations and run-time type checks.
泛型相当有用,因为他们提供强制的编译时类型检查,要求更少的数据类型之间的显式转换,并减少装箱拆箱的操作和运行时类型检查。
应用推荐