1.3. CLR and the JVM

Both .NET and Java use managed execution environments to run binary code. The two managed execution environments—the .NET CLR and Java's JVM—are quite similar in the role they play in running your code. Table 1.1 shows some of the similarities between the JVM and the CLR.

In Java, code is compiled to byte code, which is then run by the JVM. For better performance, the HotSpot JVM compiles commonly traversed parts of the byte code to native machine code. In .NET the source code is first compiled to MSIL and metadata, which is linked to form the assembly. The assembly can be an executable (EXE) file, a dynamic link library (DLL) file, or a module. At the time of execution, the MSIL and other pertinent information are sent to ...

Get .NET for Java Developers: Migrating to 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.