Java language issue
Which of the following is used by Java language, Compiler or Interpreter?

Software/Hardware used:
ASKED: January 22, 2009  7:23 PM
UPDATED: December 17, 2011  10:46 AM

Answer Wiki:
First, we should clarify that a language doesn't use a compiler or an interpreter: a compiler or interpreter uses a language to translate source code into actions (if it's interpreted) or instructions (if it's compiled). In theory, you could write a compiler for JavaScript or an interpreter for C. That said, languages are generally either interpreted most of the time or compiled most of the time (C is usually compiled, JavaScript is usually interpreted). In the case of Java, it's both. Java source code is compiled down to bytecode, which is an intermediate language. Bytecode doesn't run natively on your machine, though: the Java Virtual Machine (JVM) interprets it. So Java is compiled into bytecode, and bytecode is interpreted. Incidentally, this is how C# works, too. C# code is compiled to the Common Language Interface (CLI), which the Common Language Runtime (CLR) interprets. Java is both compiled and interpreted. Java source code is compiled into the so-called Bytecode. The Bytecode is a pre-compiled, platform independent version of your program. The .class files can be used on any operating system. When the Java application is started, the Bytecode is interpreted by the Java Virtual Mashine. Because the Bytecode is pre-compiled, Java does not have the disadvantages of classical interpreted languages, like BASIC.
Last Wiki Answer Submitted:  December 17, 2011  10:46 am  by  YuvalShavit   905 pts.
All Answer Wiki Contributors:  YuvalShavit   905 pts. , ITKE   16,755 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _