Running Java bytecode
Asked Answered
E

2

6

I am studying for a Java certificate and I got a question that I know it could be really basic. However, I am not sure:

Question: Which statement is true about Java bytecode?

a) It can run on any platform.
b) It can run on any platform only if it was compiled for that platform.
c) It can run on any platform that has the Java Runtime Environment.
d) It can run on any platform that has a Java compiler.
e) It can run on any platform only if that platform has both Java Runtime Environment and Java compiler.

I think (c) is the correct answer, assuming that the Java Runtime Environment is the interpreter.

Elderly answered 2/12, 2015 at 0:41 Comment(1)
It can run on any platform that has the Java Runtime Environment if the version is compatibleDwayne
R
12

The answer would be C.

Java bytecode is already the compiled form of the Java source code, and the Java compiler is only available with the Java Software Development Kit (SDK). Once code has been compiled, it does not need to be compiled again.

All the system needs is the Java Runtime Environment (JRE) because the JRE is able to interpret the bytecode and run it on the system.

Righteous answered 2/12, 2015 at 0:44 Comment(0)
B
1

The Java Runtime Environment (JRE) is a software package which bundles the libraries (jars) and the Java Virtual Machine, and other components to run applications written in the Java. JVM is just a part of JRE distributions.

To execute any Java application, you need JRE installed in the machine. It’s the minimum requirement to run Java applications on any computer.

So, my answer would be C.

Bathulda answered 8/3, 2021 at 15:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.