iGET

C# Programming - MCQ Practice Questions

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

290 questions | 100% Free

Q.41Medium

Which of the following is a nullable type in C#?

Q.42Medium

In C#, what does the 'params' keyword allow you to do?

Q.43Medium

What will be the output of: string s1 = "Hello"; string s2 = "Hello"; Console.WriteLine(s1 == s2);

Q.44Medium

Which collection type in C# maintains insertion order and allows duplicate elements?

Q.45Medium

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

Q.46Medium

Which of the following best describes LINQ in C#?

Q.47Medium

What is the main purpose of the 'finally' block in C#?

Q.48Medium

What is the output of: int x = 10; int y = x++; Console.WriteLine(x + " " + y);

Q.49Medium

Which keyword is used to create a constant variable in C# that cannot be changed?

Q.50Medium

Which of the following is true about the 'var' keyword in C#?

Q.51Medium

What is the output of: char ch = 'A'; Console.WriteLine((int)ch);

Q.52Medium

Which statement about method overloading in C# is correct?

Q.53Medium

Which of the following correctly demonstrates the ternary operator in C#?

Q.54Medium

Which of the following statements about ref and out parameters in C# is correct?

Q.55Medium

What will be the behavior of the following code snippet? string str = null; string result = str?.ToUpper() ?? "DEFAULT"; Console.WriteLine(result);

Q.56Medium

What is the difference between 'is' and '==' operators when comparing object references in C#?

Q.57Medium

What will be the output of the following code? class A { public virtual void Show() { Console.WriteLine("A"); } } class B : A { public override void Show() { Console.WriteLine("B"); } } A obj = new B(); obj.Show();

Q.58Medium

What is the difference between 'new' keyword and 'override' keyword in C#?

Q.59Medium

In C#, which interface is used to implement custom iteration logic?

Q.60Medium

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