Start New Discussion within our Software Development Community

i am unable to understand WHAT MAKES THE BYTECODE IN JAVA, MACHINE INDEPENDENT.
I mean how does the bytecode built after compilation becomes machine independent, or what are the properties that make the bytecode machine independent?

EXAMPLE:-
If i compiled a program on a x86-64 machine and after sometime i executed that class file(bytecode) on a SPARC machine, how is the bytecode able to execute on that machine?

PLEASE HELP............

Think of the JVM as a universal VM. JVM byte code is to JVM what x86 assembly is to x86 family of processors (sort of) with the difference being that this byte-code is not aimed at any specific processor architecture but rather a VM which runs on a variety of architectures.

The platform specific stuff is taken care by the different "JVM implementations" which are tasked with taking in the "platform independent" byte-code and translating it to the corresponding platform specific machine code. Here, the JVM installed on your machine performs the job of the translator; translating a machine independent "code" to machine specific code.

Comments
person has a lot of knowledge about the subject
This question has already been answered. Start a new discussion instead.