Bytecode is software computer object code that can only be interpreted by a software program, typically described as virtual machine. In many modern software development platforms, bytecode is preferred to low-level machine code as it places an interpreter between the software program and the computer hardware. Machine code is platform-dependent which requires compilation on each hardware platform to execute properly on that specific platform.
As the software development paradigms have matured over time, so too has the use of external layers of interpretation between the hardware of a computer and the software that runs on the computer. At the beginning of early software creation, developers were dependent on computer hardware, drivers and the underlying operating systems. This dependency forced the developers to intimately understand many aspects of the specific computers, which made platform independence very difficult and software growth tightly coupled to specific vendors of hardware and software.
The creation of bytecode has created an environment of platform independence in the software development community. With the use of this metaphor, software developers can write once and use everywhere. Developers are not forced to understand the native drivers of a specific computer, nor are they concerned with the underlying operating system on which the software will run.
A virtual machine is the term used in the Java™ programming language to represent the software program that will interpret the bytecode. This virtual machine will convert the bytecode as necessary to interact with the underlying hardware and operating system within the computer. The machine code that is generated by the virtual machine is hidden from the developer of the Java™ software program and can fully function on multiple platforms without requiring a rewrite of the software application for each platform.
The internals of bytecode are more of an advance topic and not typically necessary from most developers to understand. Bytecode is not a human readable language and consists of numeric encoded representations of classes, methods and the scope of the objects and their nesting within classes. Each bytecode opcode is one single byte in length.
The machine language required for modern computers to function on commands is proprietary in nature by vendor. Each hardware and operating system has a unique way of handling processes, memory allocation, and task utilization. By using a bytecode software development application, the virtual machine interpreter is responsible for creating the machine code that will be required to run on the proprietary platform.