Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is java both compiled and interpreted [duplicate]

Possible Duplicate:
Is Java a Compiled or an interpreted programming language?

Why is Java both compiled and interpreted language?

We first compiles the java program using javac(compiling) and the run the program using java(interpreting). What is the advantage of that?

Also, where does JIT role come into the picture?

like image 834
Anand Avatar asked Sep 05 '12 18:09

Anand


1 Answers

Compile once and run anywhere is one of the reasons.

JVM is OS specific. So, JVM interprets compiled .class (byte code) file and converts into machine specific instruction set.

like image 172
kosa Avatar answered Sep 28 '22 17:09

kosa