why java is called platform independent? | SoloLearn: Learn to code for FREE!

+8

why java is called platform independent?

8/27/2017 7:17:31 PM

Shade96

32 Answers

New Answer

+27

Because it comes with it's own virtual machine that can run the code.

+12

because it can run on any sofware or hardware platform.

+10

once you compile it into class file then it can be run on any platform like windows or linux..

+3

once u compile then u can run it as many times u can

+3

write once run anywhere on any platform

+3

because write your code on any operating system(machine) and run/execute that code on any other Operating system (machine). or you can say write once and run anywhere... java is very good and clear and fine and easy language

+3

java best techno.

+3

Java is platform independent because With Java, you can compile source code on windows and that compiled code can be executed on any platform running a JVM.

+3

Because Java is a high level mordern programming language and A platform Indipenden which means only you read to write the program and once to able to it on a number of different platform. or Java is a portable, robust, dynamic and vertually any program

+3

Read carefully when you install java in your system. then java create two folders in your program file. first one is JDK and JRE. JDK(java development kit) and another one JRE(java runtime environment) . JRE folder also have within the JDK same as second folder. when you compiled your java code using JDk tool(javac) . after successfully compilation Compiler create .class file or Byte code. then JRE have a JVM(java virtual Machine) . JVM load .class file in class loader after that JIT(just in time compiler) convert byte code into machine code. then Machine code execute by processer and give out. And the reason is why java independent Because of when can execute .class in and platform using JRE ..

+2

Because A Java virtual machine (JVM) is process virtual machine that can execute Java bytecode. Each Java source file is compiled into a bytecode file, which is executed by the JVM.

+2

When you compile the java programs, it get converted to bytecode. this bytecode can run on any operating system i.e windows,Linux,etc. So once you get the bytecode of a program there's no need to worry about operating system as it can run over any os. Hence java is platform independent. The work of translating bytecode to machine code is upto JVM. Hence, JVM is platform dependent

+2

When we compile Java Source Code JVM creates .class file which is known as byte code. This .class file can run on any platform. Hence Java is known as Platform Independent.

+2

The same code runs in all platforms. Write once. Run Anywhere...

+2

You guys are awesome :D thanksssss allll 🌸🙌🏻

+1

Thankkkk youuu

+1

java is platform independent but JVM(JAVA VIRTUAL MACHINE) which is available in java it is dependent

+1

we can run the java codings in multiple os like linus,windows,ubundu etc.,,.with the help of jvm. we can run the java class file in any environment but with the help of java compiler. java compiler has jvm(java virtual machine) it converts the source code into object code and object code into machine code. that is reason we can run the java codings in any environment.so it is called platform independent.but c and c++ has not this facility...

+1

just because of ".class" file generated after the program being compiled Nd which is acceptable in all operating system(platforms as in the questions).

+1

source code of java programmes are in bytecode which run on any machine which have JVM. These bytecode runs on JVM which is different for different machines.