C and C++ compiles into machine code of the processor on which the program was compiled. This means that the game can communicate directly with the processor in the closest way possible, ensuring that as much resources as possible go towards running the game and not wasting any resources on other stuff. C/C++ also requires more low-level operations, like talking directly with the graphic drivers and/or graphics subsystem of the operating system.

Java, on the other hand, while very optimized in the latest versions (5 and 6) does not compile into machine code, but into a Java-specific byte code that something called a Java Virtual Machine (JVM for short) understands. This byte code is platform independent, meaning that it is not tied to a specific processor or operating system, but it also means that when the application (game) is run, the JVM needs to translate the byte code into the machine code on which the program is being run. This causes overhead and a waste of resources that often cannot be wasted when making games. Also, Java is a very high-level language, and does not provide direct access to the low level layers of the OS, like the graphics driver and the graphical subsystem of the OS. This means that you cannot as efficiently work with graphics.


Blogger Templates by Blog Forum