Possible Duplicate:
How to view Java's byte code?
I want to know whether is it possible to see the code changes done by the java compiler in the class file after type erasure.
I have tried javap, but it rebuilds the original source file with the parametrized types.
The tutorial (http://docs.oracle.com/javase/tutorial/java/generics/genTypes.html) talks about replacement of parametrized type with a bounded type or an Object after type erasure. I want to see what changes are done by the compiler which is not visible with javap or any decompiler.
regards, sathwik
Type erasure literally means the generic type is dropped from the resulting byte code. It is notable by its absence. As such, all you can see that it is not there in the byte code.
When you use javap
, you will see that some generic type information is available for class, method and field signatures. This is included so the compiler can do its job to compile code using these classes. They don't do anything at runtime, although they are available via reflection so you can write a library which uses this information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With