I wanted to know what are the differences between - the bytecode in the .class files which are obtained after compilation of .java files and the byte code in the .dex file. Are they of different format? if yes, which format
A JVM .class
contains JVM bytecode. You can read the specification of JVM bytecode as part of the JVM Specification, specifically, Chapter 6: The Java Virtual Machine Instruction Set.
A .dex
file contains Dalvik bytecode. Dalvik was the original VM used by Android. It has now been replaced by the Android Runtime. The original version of Dalvik was a pure interpreter, later a compiler was added. ART used to be a pure compiler, it compiled your code once ahead-of-time when it was installed (not every time when it is run as a JIT compiler does). As of today in 2020, ART is capable of interpreting, AOT-compiling and JIT-compiling.
The major differences between JVM bytecode and Dalvik bytecode are:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With