java generic generic interface (Generic Interfaces) type parameters (Type Parameters)

The type parameters of the interface act on the entire interface, except for some fields and nested types, because fields and nested types are static by default

interface Interface <T> {
    
    
	T value; //error
    T method(); // methods
}

Reference:
http://www.angelikalanger.com/GenericsFAQ/FAQSections/TypeParameters.html#FAQ301

Guess you like

Origin blog.csdn.net/claroja/article/details/114108633