Is there any way in Java we can view the bytecodes generated by a piece of code?
JavaFAQ Home » Java Tools
Question: Is there any way in Java to
view the bytecode generated by a piece of code?
Answer: The intermediate representation
of Java code is named bytecode. Like assembler is the intermediate
representation of C/C++ programs, Java's representation is bytecode.
Bytecode is generated according to JLS - Java Language Specification. It is
simple and stright forward code. So simple that it is possible with Java
decompiler programs get back Java code
Run this command in directory where
you have your MyClass.class file and you get bytecode:
javap -c -classpath . MyClass
Printer Friendly Page
Send to a Friend
Search here again if you need more info!