Books about basics of Java told some compiler behaviors. For instance in the book - OCA Oracle Certified Associate Java SE 8 Programmer I Study Guide,
- Chapter 1 Java Building Blocks > Creating Objects > Constructors: For most classes, you don’t have to code a constructor—the compiler will supply a do nothing" default constructor for you.
- Chapter 2 Operators and Statements > Understanding Java Statements > The for Statement > The for-each Statement > Real World Scenario - Comparing for and for-each Loops: Java actually converts the for-each loop into a standard for loop during compilation
- ...
All the books only told this, but they never proved it practically with some special tools. So I would like to know is it possible to see such compiler behavior by means of some tools or just programmatically so that we can drill down the explanation from the books?
I tried the javap
, which listed only the public
instance members with the assembly instructions. I also tried the online decompile tool http://www.javadecompilers.com/, which decompiles exactly the original source code other than the intermediate code as those books told.