Wednesday, 27 November 2013

Unknown

Why java is called platform independent language?

One of the major features of java includes that why java is called platform independent language.
Before understanding this feature we need to know about -

Javac – compiler that converts source code to byte code. 
JVM- interpreter that converts byte code to machine language code. 
As we know java is both compiler & interpreter based language. Once the java code also known as source code is compiled, it gets converted to native code known as BYTE CODE which is portable & can be easily executed on all operating systems. Byte code generated is basically represented in hexa decimal format. This format is same on every platform be it Solaris work station or Macintosh, windows or Linux. After compilation, the interpreter reads the generated byte code & translates it according to the host machine. . Byte code is interpreted by Java Virtual Machine which is available with all the operating systems we install. so to port Java programs to a new platform all that is required is to port the interpreter and some of the library routines.

Source code -> javac ->Universal byte code
Universal byte ->jvm/java -> execute them on a particular machine.

Unknown

About Blog No Baap -

Since 2016 BlogNoBaap has been bringing you the very best in all types of web resources. Posted daily, and delivered straight to your inbox each morning.

Subscribe to this Blog via Email :

1 comments:

Write comments
Mridula
AUTHOR
16 April 2018 at 15:51 delete

The blog well defines the platform independence of java. The java program runs on JVM. This JVM converts the program into byte code this byte code is interpreted by another JVM, thus accounting for platform independence.

Reply
avatar