Difficulty: Easy
Correct Answer: Machine-independent code
Explanation:
Introduction:
Java compiles source files into an intermediate representation called bytecode, stored in .class files. Understanding bytecode is essential for appreciating Java’s “write once, run anywhere” promise via the Java Virtual Machine (JVM).
Given Data / Assumptions:
Concept / Approach:
Bytecode is not source code (Java code) nor is it machine-specific native code. It is a standardized, platform-neutral instruction set executed by the JVM. This indirection enables the same .class files (or packaged .jar) to run on different operating systems and CPU architectures that have compatible JVM implementations.
Step-by-Step Solution:
1) Eliminate “Java code” because bytecode is the compiled form, not the source.2) Eliminate “machine-specific code” and “native libraries” because portability is bytecode’s goal.3) Select “machine-independent code.”
Verification / Alternative check:
The JVM specification defines the bytecode instruction set and class file format, confirming its platform neutrality prior to runtime JIT compilation.
Why Other Options Are Wrong:
Common Pitfalls:
Assuming bytecode runs directly on hardware; it runs on the JVM, which may JIT-compile it to native code at runtime.
Final Answer:
Machine-independent code
Discussion & Comments