Why is it so easy to decompile Java Code? [closed]
Because Java byte-code is closer (more similar) to the source than assembly.
In particular, .class
files include metadata for classnames, method names, field & parameter types, etc...
All a Java (or .Net) decompiler needs to do is look at the instructions in each method body, and turn them into the appropriate syntactic constructs.
By contrast, native languages like C++ do not include any metadata at all, so the decompiler needs to reconstruct everything.
Java is compiled into an intermediate form, JVM bytecode, that retains a large amount of the information contained in the original Java code. A language like C++ compiles into assembly code, with looks a lot different from the original code, and is, therefore, harder to reverse.