Why is java platform independent? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why is java platform independent?

The classes and packages in java language is said to make it platform independent.. Giving it its write once run anywhere attribute... There is more to this.

26th Nov 2016, 9:20 PM
Ugwah chukwuemeka Emmanuel
Ugwah chukwuemeka Emmanuel - avatar
2 Answers
+ 3
Yes there is more to this...Java apps are interpreted by a virtual machine that is built differently depending on the OS. Java machines are like emulators so they run more slowly than apps written in C or C++ usually. You can write compiled Java apps also, but they lose their platform independent properties.
27th Nov 2016, 11:45 AM
Karl T.
Karl T. - avatar
+ 1
Java is compiled to byte code and this byte code is executed by platform dependent Java machine (Java Runtime Environment). So, byte code is platform independent (in theory ;) )
26th Nov 2016, 9:48 PM
Ivan G
Ivan G - avatar