Which one of the following is true for Virtual Machine like JVM?
2025
Which one of the following is true for Virtual Machine like JVM?
- A.
Hardware dependent
- B.
Hardware independent
- C.
Bytecode is part of VM
- D.
Links object code
Attempted by 140 students.
Show answer & explanation
Correct answer: B
A virtual machine (VM) is a software layer that provides an abstract runtime environment: programs are compiled to an intermediate, machine-independent representation, and it is the VM — not any particular processor or operating system — that executes that representation. This abstraction is what lets the same compiled program run across different hardware.
For Java specifically, source code compiles to bytecode (.class files) rather than to native machine instructions, and the JVM interprets or JIT-compiles that bytecode at runtime. Because a program targets the JVM's abstract instruction set instead of any specific CPU, the same bytecode file runs unmodified on any machine with a compatible JVM. One nuance worth separating out: the JVM software itself (the jvm.exe / libjvm.so binary) is built separately for each operating system and architecture — that is a detail of how the JVM is installed, not a property of the programs running on it. It is the bytecode and the programs it represents that stay portable, and that portability is exactly the hardware-independent property this question is testing.
Checking this against the other options confirms it:
"Hardware dependent" describes software tied to one specific processor or operating system at compile time — the reverse of what a bytecode-plus-VM design achieves.
"Bytecode is part of VM" confuses the program being executed (bytecode) with the software that executes it — the VM's own class loader, execution engine, and runtime data areas.
"Links object code" describes linking, a native-compilation step carried out by linkers for languages such as C, unrelated to how a VM runs bytecode.
So the property that correctly characterizes a virtual machine like the JVM, among those offered, is that programs running on it are independent of the underlying hardware.