tags: Java

Compiler

Translates the entire source code into machine code before execution. This results in faster execution because no translation is needed during runtime. Takes more memory.

Interpreter

Translates code line by line during execution. This makes it easier to detect errors but potentially slows down the program. Takes more time.

It is like cooking a food. with Interpreter, you have a friend who translates and tells u the instructions on spot. With Compiler, the instructions are already translated.