KnowledgeBoat Logo
|

Computer Science

A Java program uses Compiler as well as Interpreter. Explain.

Java Intro

278 Likes

Answer

Java compiler compiles Java source code to Bytecode. Bytecode cannot run on the processor directly as processor only understands Machine Code. Java Virtual Machine (JVM) takes this Bytecode as input and converts it into Machine Code line by line. So, JVM acts as an interpreter for converting Bytecode to Machine Code. In this way, a Java program uses both a Compiler as well as an Interpreter to get executed on the processor.

Answered By

169 Likes


Related Questions