Java language issue

Tags:
Compiler
Intepreter
Java
Java Language
Linux
Which of the following is used by Java language, Compiler or Interpreter?
ASKED: January 22, 2009  7:23 PM
UPDATED: December 17, 2011  10:46 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

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.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following