.NET Programming MCQs with answers Page - 54

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

A

Admin • 833.24K Points
Coach

Q. Which type cannot be inherited in C#?

  • (A) abstract class
  • (B) sealed class
  • (C) interface
  • (D) partial class

A

Admin • 833.24K Points
Coach

Q. Which method is used to add an item at the end of List<T>?

  • (A) Insert()
  • (B) Add()
  • (C) Append()
  • (D) Push()

A

Admin • 833.24K Points
Coach

Q. What will be the output?

Code:
Console.WriteLine(string.Concat("Dot", "Net"));
  • (A) Dot Net
  • (B) Dot+Net
  • (C) DotNet
  • (D) Compilation error

A

Admin • 833.24K Points
Coach

Q. Which keyword is used to define an interface?

  • (A) class
  • (B) abstract
  • (C) interface
  • (D) implements

A

Admin • 833.24K Points
Coach

Q. What will be printed?

Code:
int x = 5;
if(x != 5)
    Console.WriteLine("A");
else
    Console.WriteLine("B");
  • (A) A
  • (B) B
  • (C) Nothing
  • (D) Error

A

Admin • 833.24K Points
Coach

Q. Which LINQ method sorts data?

  • (A) Where()
  • (B) Select()
  • (C) OrderBy()
  • (D) GroupBy()

A

Admin • 833.24K Points
Coach

Q. What will be the output?

Code:
var nums = new int[]{2,4,6};
Console.WriteLine(nums.All(n => n % 2 == 0));
  • (A) True
  • (B) False
  • (C) 0
  • (D) Compilation error

A

Admin • 833.24K Points
Coach

Q. Which block always executes in exception handling?

  • (A) try
  • (B) catch
  • (C) finally
  • (D) throw

A

Admin • 833.24K Points
Coach

Q. What will be printed?

Code:
for(int i = 0; i < 2; i++)
{
    Console.WriteLine(i);
}
  • (A) 0
  • (B) 0 1
  • (C) 1 2
  • (D) Compilation error

A

Admin • 833.24K Points
Coach

Q. Which keyword is used to return a value from method?

  • (A) get
  • (B) send
  • (C) return
  • (D) output

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