Reputation: 158
As example the java-compiler transforms string1 + string2
into
new StringBuilder(string).append(string).toString();
or an enum
generates a class with final static constants
.
Is there any program where I can see in what the code will be transformed?
I tried to decompile the .class files but it was still the same code.
Upvotes: 1
Views: 59
Reputation: 94469
Java source code is transformed into byte code. Using the javap
command via the command line will allow you to view generated bytecode.
javap -c package.name.ClassName
Upvotes: 2