Using C++ as Java

Languages such as Java or C# have different compilation models. The first chapter of this book introduced the C++ compilation model. First of all, we consider C++ as a fully compilable language, while Java maintains a hybrid model. It compiles the source code into a middle representation called bytecode, and then the virtual machine runs it by translating it into the machine code for the specific platform.

The following diagram depicts the differences between the C++ and Java compilation models:

The Java virtual machine (JVM) serves as a middle tier. It has a unique implementation for each platform. Users need to install ...

Get Expert C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.