32 AnswersNew Answer
Because it comes with it's own virtual machine that can run the code.
because it can run on any sofware or hardware platform.
once you compile it into class file then it can be run on any platform like windows or linux..
once u compile then u can run it as many times u can
write once run anywhere on any platform
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
java best techno.
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.
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
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 ..
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.
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
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.
The same code runs in all platforms. Write once. Run Anywhere...
You guys are awesome :D thanksssss allll 🌸🙌🏻
java is platform independent but JVM(JAVA VIRTUAL MACHINE) which is available in java it is dependent
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...
just because of ".class" file generated after the program being compiled Nd which is acceptable in all operating system(platforms as in the questions).
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.