Java Foundations — Question 55
What is the meaning of “write once, run anywhere” in Java?
Answer options
- A. Java programs are designed to run only in web browsers and, thus, can run wherever there is a browser.
- B. It is a marketing statement because Java programs must be compiled for a specific platform in order to run.
- C. Java programs can run on any Java Virtual Machine without being recompiled.
- D. Java programs, after being compiled, can run on any platform or device even without a Java Virtual Machine.
Correct answer: C
Explanation
The correct answer is C because Java's design allows its programs to execute on any Java Virtual Machine without the need for recompilation. Option A misrepresents Java's capability by limiting it to web browsers, while option B incorrectly suggests that Java requires platform-specific compilation. Option D falsely claims that Java programs can run without a Java Virtual Machine, which is not accurate.