Generics in Java

< H1 id = "what is a wildcard" > what is a wildcard

It refers to object and its subclasses, that is, all Java objects

: element (element in container, such as collection): key: value, <, highlight group "> declare a generic class or generic method example: use a generic class or generic method example: resultdto entity (resultenum = (0 = = resultdto} resultdto} to solve the problem that the element stored in container cannot be the base class (). Keyword: insert operation is prohibited and read only. The maximum can only be the keyword of this (): the minimum can only be this, not this class. The storage type cannot be determined. Insert operation can be performed, but the operation highlight group "> fruit, highlight group" > food resultdto fruit > entity (resultenum resultenum = (0 = = resultdto} (1== ResultDTO } ResultDTO (resultEnum,data); } Error to resultdto

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>