Java's type erasure

Generic, or "parameterized types." You may be the type as a parameter to a class or a method.
It is a collection of elements specified when creating the collection type, the collection can only save their specified types of elements, avoid the use of mandatory conversion.

Generic reference to the following detailed description of this article:
Link .

Type erasure means:
generic information exists only in code compilation stage, before entering the JVM, associated with the generic information will be erased.
Generic erasing can be simply understood as generic to convert ordinary java code java code.
The main types of erase process is as follows:
A generic parameters all its leftmost border (top parent type) is replaced.
II. Removes all types of parameters.

Generic bounds Details:
Link .

Published 53 original articles · won praise 5 · Views 437

Guess you like

Origin blog.csdn.net/qq_45287265/article/details/104988113