.NET Programming MCQs with answers Page - 24

Here, you will find a collection of MCQ questions on .NET Programming. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which C# type allows storing a null value?

  • (A) int
  • (B) bool
  • (C) int?
  • (D) float

R

Ram Sharma • 3.40K Points
Extraordinary

Q. What is the purpose of `nameof()` operator in C#?

  • (A) Returns method name
  • (B) Returns string name of a variable or member
  • (C) Returns namespace name
  • (D) Returns full class path

R

Ram Sharma • 3.40K Points
Extraordinary

Q. What is the output of `true && false || true` in C#?

  • (A) true
  • (B) false
  • (C) Compilation error
  • (D) null

R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which of these represents a strongly-typed view in ASP.NET MVC?

  • (A) @model dynamic
  • (B) @model var
  • (C) @model string
  • (D) @inherits object

R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which of the following is used for thread safety in .NET?

  • (A) static
  • (B) lock
  • (C) override
  • (D) sealed

R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which LINQ method is used to sort elements in descending order?

  • (A) OrderBy
  • (B) Sort
  • (C) OrderByDescending
  • (D) Reverse

R

Ram Sharma • 3.40K Points
Extraordinary

Q. What does `Task.Run()` do in C#?

  • (A) Creates a new thread manually
  • (B) Executes code on the UI thread
  • (C) Queues work to the thread pool
  • (D) Stops execution temporarily

R

Ram Sharma • 3.40K Points
Extraordinary

Q. Which type of exception occurs when accessing an index outside an array?

  • (A) NullReferenceException
  • (B) ArgumentException
  • (C) IndexOutOfRangeException
  • (D) InvalidOperationException

R

Ram Sharma • 3.40K Points
Extraordinary

Q. What does the `var` keyword represent in C#?

  • (A) Dynamic type
  • (B) Object type
  • (C) Implicitly typed local variable
  • (D) String only

R

Ram Sharma • 3.40K Points
Extraordinary

Q. What is the function of `ModelBinder` in ASP.NET MVC?

  • (A) Bind routes
  • (B) Bind user identity
  • (C) Bind form values to model
  • (D) Bind URLs to actions

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ