iGET

C# Programming - MCQ Practice Questions

C# (.NET) MCQs — OOP, collections, LINQ & exception handling.

290 questions | 100% Free

Q.21Easy

What is the default access modifier for a class member in C# if not explicitly specified?

Q.22Easy

Which statement correctly describes value types in C#?

Q.23Easy

What is the output of: bool result = (5 > 3) && (3 < 2); Console.WriteLine(result);

Q.24Easy

Which of the following is NOT a value type in C#?

Q.25Easy

Which of the following correctly declares and initializes an array in C#?

Q.26Easy

What will be the result of: Console.WriteLine();

Q.27Easy

Which collection type in C# is best suited for key-value pair storage with unique keys?

Q.28Easy

Consider this code: int[] arr = new int[5]; foreach(var item in arr) { Console.Write(item + " "); } What is the output?

Q.29Easy

Which of the following is a correct way to declare a property with auto-implementation in C#?

Q.30Easy

In C#, what is the default access modifier for class members?

Q.31Easy

Which keyword is used to create a derived class in C#?

Q.32Easy

In C#, can a class inherit from multiple classes?

Q.33Easy

Which of the following correctly demonstrates an abstract class with an abstract method in C#?

Q.34Easy

Which access modifier allows a member to be accessed only within the same assembly?

Q.35Easy

What is the output of using 'nameof()' operator on a property in C#?

Q.36Easy

What happens when you mark a class with the 'sealed' modifier?

Q.37Easy

What does the 'base' keyword do in a derived class method in C#?

Q.38Easy

Which of the following demonstrates proper encapsulation in C#?

Q.39Easy

What is the output behavior of ToString() method when not overridden in a custom class?

Q.40Easy

In C#, which access modifier allows a member to be accessed only within the same class?