Thu Jun 28, 2007 5:41 am
The difference between C++ and Java portability and performance:
------------------------------------------------------------------
C and C++ both compile to native machine code. This means that, with a good compiler, programs written in these languages will perform very well. However, it also restricts them to running on the platform they were compiled to run on.
Java generally compiles to Java byte-code, which then runs on top of a virtual machine (the JVM). The JVM has to turn instructions in the bytecode into instructions that are understood by the machine that the bytecode is running on. This gives a runtime performance penalty (although this is getting less significant as the JVM improves and computers get faster).
However, now only the virtual machine (and standard library) have to be ported to different platforms, then the bytecode for many Java programs can be executed on that platform. So bytecode is portable accross different operating systems and processors.
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.