Junior — Middle
What reasons allow a Java program to run on different platforms without changes in the code?
sobes.tech AI
Answer from AI
A Java program can run on different platforms without changes to the code thanks to the use of the JVM (Java Virtual Machine). The code is compiled into bytecode, which is independent of the specific operating system or hardware architecture. The JVM on each platform interprets or compiles the bytecode into machine code specific to that platform. Thus, portability is achieved through hardware and OS abstraction via the virtual machine.