Home  >  Article  >  Java  >  Is java a compiled language or an interpreted language?

Is java a compiled language or an interpreted language?

王林
王林Original
2020-01-13 16:39:145497browse

Is java a compiled language or an interpreted language?

Java language seems to be compiled, because Java program code does need to be compiled.

Do you remember using the javac command in cmd? That’s right, javac is used to compile Java program code (compile .java source programs into .class files). Without compilation, .java files cannot run!

The Java language seems to be interpreted. , because Java programs need to be interpreted and run on the JVM.

(Free learning video tutorial sharing: java video tutorial)

So what type of language is Java?

Java is an interpreted language

Why is Java an interpreted language?

Java is first compiled into a .class type file by the compiler. This is a file of java's own type. Then it reads one line from the .class file through the virtual machine (JVM), interprets and executes one line, so it is an interpretation It is precisely because Java is interpreted and run on the JVM that there are different JVMs for different operating systems, so Java can achieve true cross-platform!

Is java a compiled language or an interpreted language?

A few more pictures to help understand Java’s interpretation and execution process:

Is java a compiled language or an interpreted language?

Is java a compiled language or an interpreted language?

Through the above introduction, we will have a clear understanding of the Java program execution process.

So, Java is an interpreted language with good cross-platform performance.

Recommended related articles and tutorials: java introductory tutorial

The above is the detailed content of Is java a compiled language or an interpreted language?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn