Learn C# .Net MCQs

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

What is the output of Console.WriteLine(5 == 5);?

1) true

2) false

3) Error

4) None of the above

Answer : true

Which of the following is used to get the type of an object in C#?

1) GetType()

2) typeof()

3) TypeOf()

4) None of the above

Answer : GetType()

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

1) false

2) true

3) Error

4) None of the above

Answer : false

Which of the following is true about an abstract class in C#?

1) It cannot be instantiated.

2) It can be instantiated.

3) It can be used to create objects.

4) None of the above

Answer : It cannot be instantiated.

What is the output of Console.WriteLine(5 != 5);?

1) false

2) true

3) Error

4) None of the above

Answer : false

Which of the following is the correct way to create an instance of a class in C#?

1) new ClassName()

2) create ClassName()

3) instanceof ClassName()

4) None of the above

Answer : new ClassName()

Which of the following is used to terminate a method in C#?

1) return

2) end

3) stop

4) None of the above

Answer : return

What is the output of Console.WriteLine("C# Programming".Contains("Programming"));?

1) true

2) false

3) Error

4) None of the above

Answer : true

Which of the following is true about inheritance in C#?

1) It allows a class to inherit from another class.

2) It allows a class to have multiple parents.

3) It applies only to interfaces.

4) None of the above

Answer : It allows a class to inherit from another class.

What is the output of Console.WriteLine(10 * 5);?

1) 50

2) 5

3) 10

4) None of the above

Answer : 50