Gaeburider
Gaeburider

Reputation: 158

Java code transformed to what

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

Answers (1)

Kevin Bowersox
Kevin Bowersox

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

Related Questions