Why Java is platform independent not C or C++?

When we compile C source data, it generate native code which can be understood by current operating system.
When we move this source code to the other operating system, it can't be understood by operating system because of native code that means representation is change from O.S to O.S.
So C or C++ are platform dependent .


Now in case of java, after compilation we get byte code instead of native code. When we will run the byte code,
it is converted into native code with the help of JVM and then it will be executed.

So Java is platform independent and C or C++ is not platform independent.

0 comments :

Post a Comment