When looking source of knowledge about generics Review

 

 

Never use generics because parameters can be passed to make any kind, if only so, Object directly on it. Can make use generics because the method's return value becomes the set of a specified type, so use this collection again when there is a definite type, which makes the compiler will complain when this type of change happen in the future, remind you to do the appropriate changes, rather than let the problem exposed in the operational phase. This is one of the important role generic  

When the thread pool to see the source code, the generic part of the first T

The first type is a T T of the two is used to specify that the set of parameter type and the return type is the same element type T

 

 

Guess you like

Origin www.cnblogs.com/HHHzhihao/p/10927710.html