Java compiler/interpreter

后端 未结 6 2064
野性不改
野性不改 2021-01-30 03:43

Why we do we say that Java is a compiled and interpreted language?

What is the advantage of this (being compiled and interpreted)?

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-30 04:15

    Why do we say Java is compiled and interpreted language.

    Because source code (.java files) is compiled into bytecode (.class files) that is then interpreted by a Java Virtual Machine (also known as a JVM) for execution (the JVM can do further optimization but this is anoher story).

    What is the advantage over this(being compiled/interpreted)

    Portability. The same bytecode can be executed on any platform as long as a JVM is installed ("compile once, run anywhere").

提交回复
热议问题