Featured Post

Java....Why we call it Platform Independent or Architectural Neutral??

Java a complete object oriented programming language is said to be platform independent or architectural neutral as a java program do not depend upon the operating system or hardware it is running on. The Platform independent nature can be interpreted by two things:
Operating System Independent: Independent of the operating system on which your source code is being run.
Hardware Independent: Doesn't depend upon the harware on which your java code is run upon .e. it can run on any hardware configuration.

These two points make it a platform independent language. Hence, the user do not have to change the syntax of the program according to the Operating System and do not have to compile the program again and again on different Operating Systems. The meaning of this point can be understood as you read further.

Now talking about C,C++ they are a platform dependent language's as the file which compiler of C,C++ forms is a .exe(executable) file which is operating system dependent. The C++ program is controlled by the operating system whereas, the execution of a Java program is controlled by JVM( Java Virtual Machine).

The JVM is the main component of making the java a platform independent language. For building and running a java application we need JDK(Java Development Kit) which comes bundled with Java runtime environment(JRE) and JVM. With the help of JDK the user compiles and runs his java program. As the compilation of he user source program (the java program which user writes) starts the JavaByteCode is created i.e. a .class file by the JRE. Now the JVM comes into play, which is made to read and execute this Javabytecode. The JVM is linked with operating system and runs the Javabytecode to execute the code depending upon operating system. Therefore, a user can take this class file(JavaByteCode file) formed to any operating system which is having a JVM installed and can run his program easily without even touching the syntax of a program or source code is not even required. The .class file which consists the Javabytecode is not user understandable and can be interpreted by JVM only to build it into the machine code.

The above information clearly states that why java is a platform independent or architectural neutral and why C,C++ are platform Dependent.

A java program is compiled by writing your program name with .javac.exe extension.
ex: program.javac.exe.
The above process creates a .class file which consist of Javabytecode.
Now the user runs this code by writing class file name with extension .java.
ex: program.java.
The JVM runs the program from here on and the output of program is displayed to the user.

Comments

  1. Hey
    Can you please elaborate the difference between platform independent and architecture neutral?

    ReplyDelete

Post a Comment

Let's discuss and learn more

Related Posts

Facebook in SIM Card

Microsoft To Issue Emergency Fix For Windows .LNK Flaw

Downloading icloud photos using icloudpd on linux, windows or mac

How to Convert Microsoft WMA and Rhapsody WMA to iPod

EAV versus Row modeling