Language Execution Models
The program development and execution model explains how a program is written, converted, and executed on a system. In traditional languages like C, the source code is compiled directly into machine code, which is platform-dependent and can run only on the operating system it was compiled for. In contrast, Java follows a different approach. The source code is first compiled into bytecode, which is platform-independent. This bytecode is then executed by the Java Virtual Machine (JVM), which converts it into native machine code specific to the operating system.
This is why Java follows the principle: βWrite Once, Run Anywhere.β
C Language development and execution model.β
Java Language development and execution model.β
Execution Model Summaryβ
C programs are platform-dependent because they compile directly into machine code for a specific operating system.
Java programs are platform-independent because bytecode runs on the JVM, enabling execution across multiple operating systems.