1Z0-811 · Question #14
Which two statements are true about the Java Runtime Environment (JRE)?
The correct answer is B. It interprets bytecode stored in a .class file. B is correct because the JRE contains the JVM (Java Virtual Machine), which reads and executes the platform-neutral bytecode stored in .class files - this is the JRE's core purpose. Why the distractors are wrong: A - Garbage collection is performed by the JVM, a component…
Question
Options
- AIt is responsible for garbage collection.
- BIt interprets bytecode stored in a .class file.
- CIt contains the JDK and Java APIs.
- DIt is platform independent.
- EYou must install the JRE to compile a .java file.
How the community answered
(44 responses)- B91% (40)
- C2% (1)
- D5% (2)
- E2% (1)
Explanation
B is correct because the JRE contains the JVM (Java Virtual Machine), which reads and executes the platform-neutral bytecode stored in .class files - this is the JRE's core purpose.
Why the distractors are wrong:
- A - Garbage collection is performed by the JVM, a component inside the JRE, not by the JRE itself as a whole; the distinction matters on exams.
- C - The relationship is reversed: the JDK contains the JRE (plus development tools like the compiler), not the other way around. The JRE does include Java APIs, but never the JDK.
- D - The JRE is platform-dependent - you download a different JRE for Windows, macOS, or Linux. It's the bytecode that is platform-independent ("write once, run anywhere").
- E - To compile a
.javafile you need the JDK (specificallyjavac). The JRE only handles running already-compiled.classfiles.
Memory tip: Use the hierarchy JDK ⊃ JRE ⊃ JVM - each layer contains the next. Developers need the JDK; end users only need the JRE to run programs; the JVM inside the JRE is what actually executes bytecode.
Topics
Community Discussion
No community discussion yet for this question.