Which of the following statements are TRUE about the .NET CLR? 1) It provides a language-neutral development and execution environment. 2) It ensures an application cannot access memory it is not authorized to access. 3) It provides services to run "managed" applications. 4) The resources are garbage collected. 5) It provides services to run "unmanaged" applications.

Difficulty: Easy

Correct Answer: 1, 2, 3, 4

Explanation:


Introduction / Context:
The Common Language Runtime (CLR) is the virtual machine component of .NET responsible for executing managed code, enforcing type safety, and handling runtime services.



Given Data / Assumptions:

  • Five statements about CLR capabilities are presented.
  • We must determine which are true of managed execution.


Concept / Approach:
Key CLR features include language neutrality via the Common Type System (CTS) and Common Language Specification (CLS), memory safety via verification, managed execution services, and automatic garbage collection. Unmanaged applications do not “run on” the CLR, although interop is supported.



Step-by-Step Solution:

1) Language-neutral environment — true (CTS/CLS allow cross-language interoperability).2) Memory safety/authorization — true for managed code through verification and runtime checks.3) Services for managed apps — true; CLR executes IL with JIT and provides services.4) Garbage collection — true; CLR includes GC for managed objects.5) Services for unmanaged apps — false; unmanaged code runs outside the CLR (interop exists but is not “managed”).


Verification / Alternative check:
Managed vs unmanaged boundaries in .NET documentation confirm 1–4 as standard CLR responsibilities.



Why Other Options Are Wrong:

  • Only 1 and 2: Misses 3 and 4, which are true.
  • Only 1, 2 and 4: Omits 3, which is true.
  • Only 4 and 5: Includes 5, which is false.
  • Only 3 and 4: Omits 1 and 2, both true.


Common Pitfalls:
Assuming unmanaged code executes under the CLR rather than via interop.



Final Answer:
1, 2, 3, 4

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion