Running Java bytecode

I am learning a Java certificate and I have a question that I know can be very simple. However, I'm not sure:

Question: Which statement is true regarding Java bytecode?

a) It can work on any platform.
b) It can work on any platform only if it has been compiled for that platform.
c) It can run on any platform that has a Java runtime.
d) It can work on any platform with a Java compiler.
e) It can work on any platform only if it has a Java Runtime Environment and a Java compiler.

I think (c) is the correct answer, assuming the Java runtime is an interpreter.

+4
source share
1 answer

The answer will be the C .

Java bytecode is already a compiled form of Java source code, and the Java compiler is only available with the Java Software Development Kit (SDK). After compiling the code, you do not need to compile it again.

All system needs are the Java Runtime Environment (JRE), because the JRE can interpret the bytecode and run it on the system.

+6
source

Source: https://habr.com/ru/post/1618207/


All Articles