Is there a way to display type erasure in java? I mean to see how code will look like after type erasure?
For example to show that
List<? extends Number> a; //before
List a; //after
or
class Node<T extends Number> {
private T variable;
}
become
class Node {
private Number variable;
}
and etc.
Yes. Just compile the code and use javap:
javap -c com.mypackage.MyClass
Or you can use this plugin for Eclipse: http://asm.ow2.org/eclipse/index.html
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments