什么?泛型本身也可以是nullable?上来就抛这么个问题实在是不够友好~
首先回顾,什么是泛型?Oracle Java Tutorials
Introduced in J2SE 5.0, this long-awaited enhancement to the type system allows a type or method to operate on objects of various types while providing compile-time type safety. It adds compile-time type safety to the Collections Framework and eliminates the drudgery of casting.
泛型的本质是参数化类型,也就是说操作的数据类型被指定为一个参数。简单来讲,泛型就是操作类型的占位符。
那,为什么要使用泛型?Oracle Java Tutorials
In a nutshell, generics enable types (classes and interfaces) to be parameters when defining classes, interfaces and methods. Much like the more familiar formal parameters<