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









Related Tutorials/Questions & Answers:
Why Java is a platform independent language?
platform independent
Advertisements
Platform Independent In Java - Java Beginners
Platform Independent In Java - Java Beginners
Are JVM's platform independent?
portability vs platform independent
Java Interpreter
platfrom independent
Java vs C
Why is super.super.method(); not allowed in Java?
Java is an opensource program or not? why???
Why Java as a programming Language?
What is the use of java?
why java is securable ?
Why Generics was introduced in Java?
Why bufferedreader is used in java?
why we use design patterns in java?Example?
Why on should learn Spring Java
Why You Should Learn Java in 2021?
Java Features
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?
why zero? - Java Interview Questions
why java file save as its class name
What is the meaning of Java Platform?
How to use Java?
what are the components of java platform ?
types of java platform
types of java platform
types of java platform
types of java platform
types of java platform
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 XML
Java 2 Platform-Enterprise Edition
java [ cannot retrive date from sql ] why??
Hello world (First java program)
Maven dependency for com.dooapp - languages-bindings version 0.6.7 is released. Learn to use languages-bindings version 0.6.7 in Maven based Java projects
Maven dependency for com.dooapp - languages-bindings version 0.4.9 is released. Learn to use languages-bindings version 0.4.9 in Maven based Java projects
Maven dependency for com.dooapp - languages-bindings version 0.2.12 is released. Learn to use languages-bindings version 0.2.12 in Maven based Java projects
Maven dependency for com.dooapp - languages-bindings version 0.2.26 is released. Learn to use languages-bindings version 0.2.26 in Maven based Java projects
Maven dependency for com.dooapp - languages-bindings version 0.2.18 is released. Learn to use languages-bindings version 0.2.18 in Maven based Java projects
what fastest DataStructre(efficient) in java? and why? - Java Beginners
why my keyevent not function ? - java swing -
why my keyevent not function ? - java swing -
why the occupancy rate is zero? - Java Interview Questions

Ads