In C we use only compiler. Why java uses both compiler and
interpreter? What is its significance?

Answer Posted / kuldeep sharma

Java is Platform Independent language it uses Virtual
System (JVM) in an existing operating system to run
programs.
The JVM itself is not Platform independent it is platform
dependent. but its functionality is same for all verison of
JVM for different OSs.

The Source Code of a Java Program is compiled to avail the
advantages of compiler like fast development, i mean all
the errors are checked and displayed by the compiler at once
(in 99.99% cases) to make the code error free.

An error free Java Code is converted into BYTECODE ;
directly understood by the JVM(for all OSs).

Now consider we compiled a.java >> a.class on linux, the
a.class is portable and runnable on other OS like Windows
because class files are fun by JVM but not by the OSs that
why we can say
Java is platform Independent.

Is This Answer Correct ?    12 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can java hashmap have duplicate keys?

502


What is subsequence of a string?

594


What language is an assembler written in?

539


If an object reference is set to null, will the garbage collector immediately free the memory held by that object?

625


Is zero a natural number?

556






What is unmodifiable list in java?

523


What is passing parameters in java?

509


How does thread synchronization occurs inside a monitor?

542


What are filterstreams?

601


Can there be an abstract method without an abstract class?

527


What are the wrapped, classes?

587


Can java program run without jre?

558


What is a literal coding?

504


What is the static variable?

568


What is the main difference between java platform and other platforms?

495