4 ms·
Type erasure prevents runtime access to type information. If type is preserved, in certain scenario it could be handy, like dynamically checking whether certai
by eva1984 10y ago
Type erasure prevents runtime access to type information.
If type is preserved, in certain scenario it could be handy, like dynamically checking whether certain class conforms to generic type(better instanceof operator).
One example is the Gson library, looks at what twisted hack it uses to preserve the generics information at runtime(hints: TypeToken class).