iGET

C# Programming - MCQ Practice Questions

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

290 questions | 100% Free

Q.1Easy

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

Q.2Easy

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

Q.3Easy

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

Q.4Easy

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

Q.5Easy

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

Q.6Easy

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

Q.7Easy

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

Q.8Easy

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

Q.9Easy

Which of the following demonstrates proper encapsulation in C#?

Q.10Easy

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

Q.11Easy

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

Q.12Easy

What is the primary purpose of using interfaces in C#?

Q.13Easy

In C# inheritance, which keyword allows accessing members of the parent class?

Q.14Easy

Which of the following best describes encapsulation in C#?

Q.15Easy

What is the purpose of the 'base' keyword in C#?

Q.16Easy

What is the output of this C# code? public class Employee { private string name = "John"; public Employee(string n) { name = n; } } Employee emp = new Employee("Alice"); Console.WriteLine(emp.name);

Q.17Easy

Which of the following best describes the 'this' keyword in C#?

Q.18Easy

What is the primary purpose of encapsulation in OOP?

Q.19Easy

Which keyword is used to create a class that cannot be instantiated in C#?

Q.20Easy

In C#, what is the correct syntax to implement multiple interfaces in a class?