Why java is called platform independent language ?


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.

Another reason the makes Java a Platform independent language is the elimination of undefined or architecture dependent constructs.
Therefore java is called platform independent language.



Comments 018

  • Hari Krishnan

    October 23, 2013 7:44 am · Reply

    Neat Explanation!!!!

  • divyadamu

    December 31, 2013 3:35 am · Reply

    very nice explanation

  • SUMA

    March 20, 2014 6:04 am · Reply

    Good explanation.. I am a java learner
    you mentioned elimination of architecture dependent constructs.
    could you explain it in detail

  • mallinath

    March 26, 2014 12:51 pm · Reply

    best explanation.

  • aswanivs

    March 31, 2014 7:49 am · Reply

    its good.so helpfil

  • jeena

    June 7, 2014 6:35 am · Reply

    Good Answer

  • vishnu

    June 23, 2014 1:22 pm · Reply

    best understandable….thanks

  • githu

    June 30, 2014 10:27 am · Reply


  • mouni

    July 10, 2014 5:40 pm · Reply

    that’s really good to understand…thank u so much:)

  • Manimaran R

    July 17, 2014 4:55 am · Reply

    Very useful in beginners

  • vignesh

    July 20, 2014 4:54 am · Reply

    i want to exact meaning of why java is platform independent. ur ans is fine but i want more exact ans.

  • Maddy Madhavan

    July 23, 2014 12:20 pm · Reply

    shot and sweet

  • krishnanand krishnmurti

    August 21, 2014 7:11 pm · Reply

    you have very well definition given to me that how of this java platform independent language and good explanation.so i am very happy after getting this definition.

  • kamal

    September 16, 2014 1:50 pm · Reply

    Very helpful thanks a lot

  • shivangi

    September 27, 2014 2:02 pm · Reply

    precise explaination.

  • rachana

    October 13, 2014 6:01 pm · Reply

    Gud explanation

  • gowthami

    October 24, 2014 6:25 pm · Reply

    Thank you,It helped me

  • Kislay

    November 27, 2014 5:31 am · Reply

    now this is some what near to the correct explanation. Good for people who are starting new.


Leave a Comment

five − = 3