Learn C# .Net MCQs

Prepare C# .Net MCQs (Multiple choice Questions) for exam and job interviews.

What is the output of Console.WriteLine("1" + 1);?

1) 11

2) 2

3) Error

4) None of the above

Answer : 11

Which of the following is a valid way to create a new instance of a class in C#?

1) ClassName obj = new ClassName();

2) ClassName obj;

3) new ClassName obj();

4) None of the above

Answer : ClassName obj = new ClassName();

Which of the following statements is true about a constructor in C#?

1) It has the same name as the class.

2) It cannot have parameters.

3) It cannot be overloaded.

4) None of the above

Answer : It has the same name as the class.

What is the output of Console.WriteLine(10 == 10 && 5 > 3);?

1) true

2) false

3) Error

4) None of the above

Answer : true

Which of the following is used to create an abstract method in C#?

1) abstract void MyMethod();

2) void MyMethod abstract();

3) void MyMethod();

4) None of the above

Answer : abstract void MyMethod();

What is the output of Console.WriteLine(4 + "5");?

1) 45

2) 9

3) Error

4) None of the above

Answer : 45

Which of the following is a collection class in C#?

1) ArrayList

2) List

3) Dictionary

4) All of the above

Answer : All of the above

What is the output of Console.WriteLine(2 > 1 || 1 > 2);?

1) true

2) false

3) Error

4) None of the above

Answer : true

Which of the following keywords is used to handle exceptions in C#?

1) catch

2) try

3) throw

4) All of the above

Answer : All of the above

What is the output of Console.WriteLine(2 + "2");?

1) 22

2) 4

3) Error

4) None of the above

Answer : 22