Why Java is a platform independent language?

Why Java is a platform independent language?

Hi,

Java can be used with any platform. How and Why Java is a platform independent language?

Thanks

View Answers

April 22, 2017 at 4:22 PM

Hi,

Java is Platform Independent programming language it means that if you compile it on the windows platform you can run the program on any platform for example on Mac, Linux, Unix etc.

So, Java supports "Write once run anywhere" concept and it allows you to run your program anywhere.

Why Java is Platform Independent?

Due to bytecode: Java program is compiled into byte code and the byte code then runs on the targeted platform. On the targeted platform it is (byte code) is compiled into binary language in run-time by JVM and then it runs.

JVM: JVM is actually platform dependent and you need to have different JVM for different platforms. JVM makes Java program platform independent. Check for more detail: Java Virtual Machine(JVM). Thanks


April 19, 2020 at 5:14 PM

Hi,

Java is platform independent language because it compiles the Java source code into bytecodes. The bytecodes is not the machine code and it needs a special program call interpreter for converting it into machine code. In case of Java JIT (Just-in-time) compiler is the Interpreter which converts the compiled bytecodes into machine language on the host machine. Once the bytecodes is converted into machine language it is executed on the host machine.

The JVM is available for almost all the operating system and you can deploy your compiled Java code (in jar format) on the variety of platforms.

Check the tutorial: Java Interpreter is used for which purpose?

Above tutorial shows you the working of Java Compiler and Interpretor.

Thanks


April 19, 2020 at 5:17 PM

Hi,

Here is more detail about the Java Programming language. Check it at:

Thanks

Ads









Related Tutorials/Questions & Answers:
Why Java is a platform independent language?
platform independent
Advertisements
Are JVM's platform independent?
portability vs platform independent
Java Interpreter
Why Java as a programming Language?
Why is super.super.method(); not allowed in Java?
Java is an opensource program or not? why???
Why Generics was introduced in Java?
Why bufferedreader is used in java?
why we use design patterns in java?Example?
Why You Should Learn Java in 2021?
Why on should learn Spring Java
How to use Java?
What is the meaning of Java Platform?
why we use constructors instead of methods in java?
why java program not run with msword editor
Why does Java not support operator overloading?
Why doesn't Java allow overriding of static methods?
what are the components of java platform ?
why java file save as its class name
types of java platform
types of java platform
types of java platform
types of java platform
types of java platform
Java XML
what is java and why do i need it?
why we use abstract class in java?
Which java collection to use in scenario below and Why?
Java 2 Platform-Enterprise Edition

Ads