How java is platform independent?

Answer Posted / ranganathkini

In the classic sense of software development, programs are
coded in higher level languages such as C/C++, then that
source code needs to be compiled into native machine
language specific to that platform so that the program is
made executable.

Java compiler on the other hand does not compile Java source
files into native machine language, instead it compiles the
source code into bytecodes. These bytecodes are platform
independant i.e. in other words specific to to the Java
Virtual Machine specification. This enables platform
independant compilation.

When the bytecode compiled programs are executed thru the
Java interpeter, it converts those bytecodes into native
machine code and executes them thru the JVM which is
specific to host environment it is running on. This enables
platform specific execution.

Is This Answer Correct ?    380 Yes 37 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is consumer interface?

556


When is an object subject to garbage collection?

576


What is strings in java?

583


What are basic keywords?

555


What is object english?

581






What is natural ordering in java?

521


How to create an interface?

623


What is difference between jdk,jre and jvm?

563


What do you understand by private, protected and public?

519


How a variable is stored in memory?

495


What is a Hash Table? What are the advantages of using a hash table?

603


Can list be final in java?

485


What is public/private protected in java?

541


Is singleton thread safe in java?

545


Explain the difference between intermediate and terminal operations in java8?

564