Multiple choice technology web 2.0

Which one of the following statements is true with respect to the Common Language Runtime (CLR)?

  1. The Common Language Run-time compiles source code to MSIL code.

  2. The C# and VB.NET compilers compile source code to native code

  3. Code compiled in one .NET language can interact with code compiled in a different .NET language

  4. The CLR does NOT implement a Common Type System

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The CLR enables language interoperability in .NET by allowing code compiled in one .NET language (like C#) to interact with code compiled in another .NET language (like VB.NET). This is possible because all .NET compilers compile to MSIL (Microsoft Intermediate Language), which the CLR executes, and the CLR implements a Common Type System (CTS) ensuring type compatibility across languages.

AI explanation

Language-specific compilers (csc.exe for C#, vbc.exe for VB.NET, etc.) compile source code into Microsoft Intermediate Language (MSIL/CIL) plus metadata — the CLR itself does not do this compilation step. At runtime, the CLR's Just-In-Time (JIT) compiler translates MSIL into native machine code for the host CPU. Because all .NET languages target the same MSIL and share the Common Type System (CTS), code written in one .NET language (e.g., C#) can seamlessly call and interoperate with code written in another (e.g., VB.NET) — this is one of the CLR's defining features. So option 3 ('Code compiled in one .NET language can interact with code compiled in a different .NET language') is the true statement; the other three options each get a CLR fact backwards.