+ 3
What is the difference b\w machine language and bytecode?
5 Antworten
+ 11
1. Your source code (.java file) is compiled into bytecode (.class file). This bytecode can be run on all machines.
2. In order to run the bytecode the (.class file) has to be internally converted into machine code.
This machine code is specific to the Operating System (OS) and can only be run on that OS.
The java virtual machine (JVM) which converts the bytecode into machine code is OS specific.
+ 5
bytecode is the same all over, but machine varies according to the operating system
+ 4
JVM translates bytecodes into machining code
+ 2
Also machine code is comprised of 1's and 0's Java code is human readable code. much in the same way an assembler translates CPU instruction sets for different operating systems installed on it the JVM translates java byte code for that operating system.
+ 1
this is the product of the compiler
that is that compiler converts your source code(.Java file) into bytecode (.class) and then the JVM converts the bytecode into machine language which is understandable by your system across different platforms.
the JVM is platform specific.
the machine codes are specific to certain os that is different operating systems ( OS ) have different machine codes