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 you sort a list in java?

730


What are synchronized methods ?

834


If we allocate the memory using 'new' & de-allocated using 'free' then what will happen?

816


Why bytecode is called bytecode?

815


Difference between ‘is-a’ and ‘has-a’ relationship in java?

776


Why Java is not pure Object Oriented language?

872


How can you set the applet size?

814


what is the difference between preemptive scheduling and time slicing? : Java thread

765


What is javac used for?

698


Why should I use abstract class?

777


How many types of interfaces are there?

775


If a class is declared without any access modifiers, where can the class be accessed?

806


What are different types of encoding?

825


What is difference between call by value and call by reference?

713


What is concurrent hashmap and its features?

761