nerdexam
Oracle

1Z0-808 · Question #25

Which statement is true about Java byte code?

The correct answer is C. It can run on any platform that has the Java Runtime Environment. Java bytecode is platform-independent compiled code that requires the Java Runtime Environment (JRE) to execute - the JRE contains the JVM (Java Virtual Machine), which interprets bytecode into machine-specific instructions at runtime, making C correct. A is wrong because "any…

Java Basics

Question

Which statement is true about Java byte code?

Options

  • AIt can run on any platform.
  • BIt can run on any platform only if it was compiled for that platform.
  • CIt can run on any platform that has the Java Runtime Environment.
  • DIt can run on any platform that has a Java compiler.
  • EIt can run on any platform only if that platform has both the Java Runtime Environment and a Java compiler.

How the community answered

(18 responses)
  • C
    94% (17)
  • D
    6% (1)

Explanation

Java bytecode is platform-independent compiled code that requires the Java Runtime Environment (JRE) to execute - the JRE contains the JVM (Java Virtual Machine), which interprets bytecode into machine-specific instructions at runtime, making C correct.

  • A is wrong because "any platform" is too absolute - the platform must have the JRE installed.
  • B is wrong because bytecode is not compiled for a specific platform; that's the whole point of Java's "compile once, run anywhere" design.
  • D is wrong because a compiler (like javac) turns .java source into bytecode - it's not needed to run already-compiled bytecode.
  • E is wrong because only the JRE is needed to run bytecode, not the compiler.

Memory tip: Think of the JRE as the "player" and bytecode as a "disc" - you need the player (JRE) to play the disc, not the recording studio (compiler).

Topics

#Java bytecode#JRE#platform independence#compilation

Community Discussion

No community discussion yet for this question.

Full 1Z0-808 Practice