Multiple choice technology programming languages

A program written in the Java programming language can run on any platform because...

  1. Java programming is derived from C++.

  2. The Java Virtual Machine(JVM) interprets the program for the native operating system.

  3. The compiler is identical to a C++ compiler.

  4. The APIs do all the work.

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Java achieves platform independence through its 'write once, run anywhere' capability via the Java Virtual Machine (JVM). Java source code compiles to bytecode, which is then interpreted by the JVM specific to each operating system. The JVM acts as an intermediary, translating the bytecode into native machine instructions for the underlying platform. Option A incorrectly suggests C++ derivation, while option C is wrong because Java compilers are platform-specific, not identical to C++ compilers.