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

How do you reverse a list?

652


What is the purpose of the strictfp keyword?

694


How many bytes is a char in java?

639


What are the types of web technologies?

648


how to create multithreaded program? : Java thread

614






What are the two categories of data types in the java programming language?

599


What is the difference between overriding and overloading in OOPS.

661


What is balanced tree in java?

611


Why main() method is public, static and void in java ?

687


What is sortedset in java?

662


Is arraylist a class in java?

619


What is use of inner class in java?

622


can java object be locked down for exclusive use by a given thread? : Java thread

648


What is a method vs function?

653


Can you create an object of an abstract class?

653