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's platform independence comes from the JVM. Java source code compiles to bytecode, which the JVM interprets or compiles to native machine code for each specific platform. This abstraction layer is what enables 'write once, run anywhere'. Option A is incorrect - C++ is platform-dependent. Option C is wrong - Java compilers are not identical to C++ compilers. Option D is false - APIs alone don't provide platform independence.