O'Reilly logo

From Java to C#: A Developer's Guide by Heng Ngee Mok

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

1.4. Intermediate language

How does Java achieve platform independence? Java source codes are compiled into byte codes (which are stored in .class files) by the Java compiler. Byte codes are portable because when they are executed, they are interpreted on-the-fly by the JVM for that specific platform. The JVM – for say the Macintosh operating system – understands both byte codes and how to translate them into native Macintosh machine codes that the Mac operating system understands. Similarly, the JVM for the Windows operating system knows how to translate byte codes into native machine codes for the Windows operating system.

The idea is suspiciously similar for .NET (see Figure 1.1). .NET source codes (whether written in J#, C# or any other .NET ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required