what is difference between compiler and interpreter

Опубликовано: 21 Июль 2026
на канале: Java code&Decode
1,188
3

core java tutorial for beginners with examples,java,core java,java tutorial,core java tutorial,java videos,core java videos,java video tutorials,javabook,java book,javabook.in,scanner class in java,scanner in java,util package,java util package,Java scanner,scanner class,user input in java,java scanner class tutorial,java scanner class what is difference between compiler and interpreter ?
Interpreter
Translates program one statement at a time.
It takes less amount of time to analyze the source code but the overall execution time is slower.
No intermediate object code is generated, hence are memory efficient.
Continues translating the program until the first error is met, in which case it stops. Hence debugging is easy.
Programming language like Python, Ruby use interpreters.

Compiler
Scans the entire program and translates it as a whole into machine code.
It takes large amount of time to analyze the source code but the overall execution time is comparatively faster.
Generates intermediate object code which further requires linking, hence requires more memory.
It generates the error message only after scanning the whole program. Hence debugging is comparatively hard.
Programming language like C, C++ use compilers.