Translators, Compilers, Interpreters, and Bytecode in Java - Quiz
Total: 7 questions
1. What is a translator?
A program that converts code from one language to another, usually source code into machine code.
2. Into which two types are translators divided?
Compilers and interpreters.
3. How does a compiler differ from an interpreter?
A compiler converts the whole code before execution, while an interpreter executes the code line by line at runtime.
4. Into which file does the javac compiler convert Java source code?
A .class file (bytecode).
5. What is bytecode?
A platform-independent intermediate representation of a program that the JVM executes.
6. What does the JVM do with bytecode?
It interprets it and JIT-compiles the hot sections into native machine code.
7. Why is Java both portable and fast?
Bytecode runs on any JVM, which gives portability, while JIT compilation provides speed close to compiled languages.
Page 1 of 1