Java (programming language) Created 2026-10-13 Updated 2026-11-05
Java is a class-based, statically typed programming language whose ordinary implementation compiles source into bytecode for a Java virtual machine. Its type system, exception rules and object model specify program behaviour; the virtual machine supplies execution and managed storage. Generics in Java add parameterized types checked largely at compilation, with type erasure shaping their runtime representation. The Java language, the virtual-machine specification and a particular vendor's development kit are separate layers, so an implementation detail should not be mistaken for a universal language rule.[ref]
// Target: computer-science.bigb
Java virtual machine 2026-11-05
The Java virtual machine is the abstract execution machine specified for Java class files and bytecode. It defines runtime data areas, stack frames, operand stacks, local variables and instruction behavior, while leaving implementation choices such as interpretation and just-in-time compilation open.[ref]
For example, two integer loads followed by an integer-add instruction obtain operands from a stack frame and leave their sum on its operand stack. A method call establishes a new stack frame and later returns a result to its caller. These specified effects remain the contract even if a compiler keeps the values in native registers and emits one machine instruction. The virtual-machine interface therefore supports portable compiled code without requiring every implementation to execute bytecode one instruction at a time.
Operand stack 2026-11-05
An operand stack holds intermediate values used by bytecode operations in a Java virtual machine method invocation. Each stack frame has its own last-in-first-out operand stack, initially empty; its maximum depth is recorded in the class file. Values can be loaded from local variables, consumed by operations and replaced by results.[ref]
Starting from an empty operand stack,
iconst_2; iconst_3; iadd produces the successive contents 2, 2,3 and 5, with the top shown at the right. The addition consumes both operands. This abstract execution rule does not require a physical memory push for each operation: just-in-time compilation may retain values in processor registers while preserving the specified behavior. Virtual machine 2026-11-05
A virtual machine presents a specified machine interface implemented using another system. A system virtual machine supplies virtual processors, memory and devices to a guest operating system. A hypervisor mediates access to the underlying resources; execution can combine hardware assistance and software emulation.[ref]
Introduction to System Emulation in the QEMU documentation. system emulation and virtualisation accelerators
For example, a guest can maintain its own kernel and filesystem view while a host schedules several guests on one physical machine. A Java virtual machine instead exposes a bytecode execution model to programs, illustrating a different level of abstraction. A container usually shares the host kernel rather than supplying a separate full guest kernel. The interface being virtualized determines which compatibility and isolation properties a particular virtual machine provides.