You are on page 1of 2

Java is a platform-independent language

already we have discussed various

features of Java like simple platform

independent and object-oriented and so

on

among them platform independent is the

best feature of Java now in this lesson

we are going to discuss how Java is a

platform independent first let's see

what's meant by platform independent

platform independent means writing codes

in one operating system for example

Windows XP and executing that code on

another platform for example Linux

simply called wara

which means write once and run anywhere

this phenomenon is called platform

independent do you know how Java becomes

platform independent yes it is due to

the key phenomena of bytecode bytecode

is a machine language of the Java

Virtual Machine by using bytecode

execution Java proves it's a platform

independent language let us discuss the

execution of Java bytecode now you are

looking at the figure that explains the

execution flow of the Java program first

write your source code in a plain text

file and save it with the dot Java

extension using Java C compiler the


source code is compiled into dot class

files a dot class file contains a source

code in the form of bytecode bytecode is

a machine language of the Java Virtual

Machine or JVM Java interpreter and JIT

compiler are present inside JVM JVM

converts the bytecode dot class into

executable code dot obj with the help of

interpreter or JIT compiler as needed

this dot obj file is used to generate

the output different types of JVM are

available on different operating systems

such as the Sun JVM

the Microsoft JVM and the IBM JVM etc

using the JVM the same dot class files

can run on various platforms this is the

way byte code executes Java programs and

proves Java is a platform independent

language tips do you know what is meant

by JIT compiler let me tell you the JIT

compiler is a compiler that converts

program source codes into native machine

codes just before running the program

the JIT compiler is faster and more

efficient to perform huge applications

You might also like