answersLogoWhite

0


Best Answer

Java solves the problem of platform-independence by using

byte code. The Java compiler does not produce native

executable code for a particular machine like a C compiler

would. Instead it produces a special format called byte

code. Java byte code written in hexadecimal, byte by byte,

looks like this:

CA FE BA BE 00 03 00 2D 00 3E 08 00 3B 08 00 01 08 00 20 08

This looks a lot like machine language, but unlike machine

language Java byte code is exactly the same on every

platform. This byte code fragment means the same thing on a

Solaris workstation as it does on a Macintosh PowerBook.

Java programs that have been compiled into byte code still

need an interpreter to execute them on any given platform.

The interpreter reads the byte code and translates it into

the native language of the host machine on the fly. The most

common such interpreter is Sun's program java (with a little

j). Since the byte code is completely platform independent,

only the interpreter and a few native libraries need to be

ported to get Java to run on a new computer or operating

system. The rest of the runtime environment including the

compiler and most of the class libraries are written in Java.

All these pieces, the javac compiler, the java interpreter,

the Java programming language, and more are collectively

referred to as Java.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

When Java Code is compiled a byte code is generated which is independent of the system. This byte code is fed to the JVM (Java Virtual Machine) which resides in the system. Since every system has its own JVM, it doesn't matter where you compile the source code. The byte code generated by the compiler can be interpreted by any JVM of any machine. Hence it is called Platform independent Language.

Java's bytecodes are desgined to be read and interpreted in exactly same manner on any computer hardware or operating system that supports Java Runtime Environment.

The Java Virtual Machine can be called a virtual operating system that enables a java programme to run... we are thus calling java platform independent because a java program will not give different outputs on different machines but platform dependent programmes tend to give different results when compiled on different machines...

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

A Java program execution consists of compilation as well as interpretation.

Compiler- This part converts the program written in high level level language to byte code[an intermediate code].

This byte code is the reason for which Java is Platform Independent. This byte code can be traveled from machine to machine.

Interpreter- There are different interpreters of byte code of java for different

different platforms. They convert the byte code to the respective

machine language which the machine can understand.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

When you program in any programming language, you compile your program before executing it. Compiling your program means you've converted your source code ( text ) into machine code( which can be executed)... Every machine has a different set of rules to execute a program... for example, Linux executes program differently than Microsoft Windows and Mac OS. So the compilers for these OS compile program differently. This is not the case with Java.. Java compiler compiles the source code into ByteCode, which is analogue to machine. The user must install Java VM, which then converts the ByteCode into machine code. Now the Java VM interprets the ByteCode according to machine.. So once you've Compiled your program ( turned into ByteCode) you can execute it anywhere( Java VM must be installed, and usually is installed).

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

Java is known as platform-neutral language because Java's bytecodes are designed to be read, interpreted, and executed in exactly the same manner on any computer hardware or operating system that supports a Java run-time.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

Because it will work on all platforms because it's code is compiled through it's on Virtual Machine, the JVM (Java Virtual Machine).

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why is java is neutral platform independent?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Why java script called as platform independent?

java also called as platform independent.because we will use java application at any operationg system and any hardware. it not contain error. so we called java as platform independent..


Why you are preferring java?

java is platform independent language and open source. java is object oriented language.


Is java fully platform independent?

Java is a platform independent language.After compiling the ".java" file ,that will be converting into the ".class" file,which is a byte code having the capability run on any OS.Basing on the concept byte code java achieving the platform independent,it leads to "Write once run anywhere".


Why java is platform independent explain by diagram?

Java is a platform independent language becoz of the bytecode magic of java. In java, when we execute the source code...it generates the .class file comprising the bytecodes. Bytecodes are easily interpreted by JVM which is available with every type of OS we install.


Why is Java not 100 percent platform independent?

AnswerJava is platform independent while JVM is platform dependent. In Java ,you can compile code in to class file and you can run it in any OS without altering your code.But for interpreting class to bytes we need JVM .so it act as a bridge between your class file and OS. Now a days JVM is available for all OS.So Java attains platform independent.AnswerDepending on your definitions, no language may be truly platform independent. A language like Java needs a virtual machine to run the platform independent bytecode. But this virtual machine must run natively on a given physical machine, which means that the JVM in platform dependent. If someone tells you that Java is not completely platform independent, this is probably what they are referring to.

Related questions

Why java script called as platform independent?

java also called as platform independent.because we will use java application at any operationg system and any hardware. it not contain error. so we called java as platform independent..


Why java called platform indeependent?

Platform independent language means once compiled you can execute the program on any platform (OS). Java is platform independent. Because the Java compiler converts the source code to bytecode, which is Intermidiate Language. Bytecode can be executed on any platform (OS) using JVM( Java Virtual Machine).


On what platform Java can work?

Java is a platform independent language. It can be used in all platforms. Ex: windows, unix etc.


Why java is platform independent and also prove how it is possible?

WHY MEANS the java is a platform independent language for the sake of it has its own platform to run the program it doesn't require any platforms like c and C++


Why you are preferring java?

java is platform independent language and open source. java is object oriented language.


Is java fully platform independent?

Java is a platform independent language.After compiling the ".java" file ,that will be converting into the ".class" file,which is a byte code having the capability run on any OS.Basing on the concept byte code java achieving the platform independent,it leads to "Write once run anywhere".


Why java is called platform independent not operating system independent?

A "platform" is whatever environment in which Java is running. This includes operating systems. A Java source file on compilation produces an intermediary .class rather than a executable file. This .class file is interpreted by the JVM. Since JVM acts as an intermediary layer.


Why java called as platform independent?

Java is called as platform independent because it uses the WORA(Write Once and Run Anywhere) principle. Java programming language is designed to be run under any OS and that is the main advantage of it.


Why java is platform independent explain by diagram?

Java is a platform independent language becoz of the bytecode magic of java. In java, when we execute the source code...it generates the .class file comprising the bytecodes. Bytecodes are easily interpreted by JVM which is available with every type of OS we install.


Why is Java not 100 percent platform independent?

AnswerJava is platform independent while JVM is platform dependent. In Java ,you can compile code in to class file and you can run it in any OS without altering your code.But for interpreting class to bytes we need JVM .so it act as a bridge between your class file and OS. Now a days JVM is available for all OS.So Java attains platform independent.AnswerDepending on your definitions, no language may be truly platform independent. A language like Java needs a virtual machine to run the platform independent bytecode. But this virtual machine must run natively on a given physical machine, which means that the JVM in platform dependent. If someone tells you that Java is not completely platform independent, this is probably what they are referring to.


Who makes java platform independent?

JVM makes Java Platform Independent.. It loads byte code(.class file) and Run it.


Why JVM is platform independent?

by creating a jre spesific to each platform programmers can confidently write code in any platform and assume it willl also work in aany other. theirfore java is platform independent as bytecode would look the same on any platform, however will be implemented by a diffrent interpreter for each platform.