why java is platform independent?

Answer Posted / liza

Java compiler compiles the .java file(source code) by
generating the .class file comprising the bytecodes.

Bytecodes are platform independent and can be executed in a
system where JVM is installed.

JVM interpretes bytecodes into machine code depending upon
the underlying OS and H/W combination.

JVM provides a machine interface that does not depend on the
underlying OS and machine H/W architecture, thus making JAVA
as platform independent.

This makes java program as write-once run-anywhere.Only we
need to install compatible JVM, bcoz JVM is platform dependent.

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the benefit of inner classes in java?

848


What methodology can be employed to locate substrings inside a string?

719


What types of index data structures can you have in java?

853


What is the use of static class?

779


What is the function of static in java?

763


What are the basic interfaces of java collections framework?

836


What is identifier with example?

795


what is meant by Garbage collection?

827


Can set contain duplicates?

765


What is meant by object?

784


What do you mean by Hash Map and Hash Table?

803


what is the difference between a threads start() and run() methods? : Java thread

769


Write code of any action class?

733


What is jpa specification?

731


What is meant by string is immutable?

732