Topic / 95 questions

C# MCQs

Page 5 of C# multiple-choice questions with answers. Tap an option to check yourself.

Page 5 of 5

Question 82 C#

What is the role of the JIT compiler in .NET?

Correct answer D. It converts CIL into native machine code when methods are first called at run time

Open question
Question 83 C#

What is meant by ‘managed code’ in .NET?

Correct answer C. Code whose execution is controlled by the .NET runtime, which handles memory and safety services

Open question
Advertisement
Question 84 C#

In .NET, what is an assembly?

Correct answer A. A compiled unit of deployment and versioning, such as a .dll or .exe, containing CIL and a manifest

Open question
Question 85 C#

What does the .NET Base Class Library (BCL) provide?

Correct answer D. Core types such as System.String, collections, file I/O and threading used by all .NET programs

Open question
Question 86 C#

When does the .NET garbage collector reclaim the memory of an object?

Correct answer D. When the object is no longer reachable from any root, at a time chosen by the runtime

Open question
Advertisement
Question 94 C#

What is int? in C#?

Correct answer B. Shorthand for Nullable<int>, an int that can also hold null

Open question
Question 95 C#

In .NET, what does the Common Language Runtime (CLR) mainly provide?

Correct answer C. A managed execution environment with memory management, type safety and exception handling

Open question
Advertisement