C# Programming - MCQ Practice Questions
C# (.NET) MCQs — OOP, collections, LINQ & exception handling.
290 questions | 100% Free
Which keyword is used to create an immutable class member in C#?
What is the difference between 'var' and explicit type declaration in C#?
Which of the following is a reference type in C#?
What will happen if you try to access an array element beyond its bounds?
What is the output of: int x = 5; Console.WriteLine(x++);
Which of the following statements about abstract classes is correct?
What is the correct syntax for a multi-line comment in C#?
Which access modifier allows access from derived classes only?
What is the output of: Console.WriteLine(5 == 5.0);
Which of the following correctly declares a jagged array?
What is the purpose of the 'using' statement in C#?
Which of the following is NOT a valid C# data type?
Consider: int[] arr = {1, 2, 3}; What happens when you try to resize it using Array.Resize(ref arr, 5)?
What will be the output of: int x = 10; int y = x; y = 20; Console.WriteLine(x);
What will be the output of: sbyte x = -128; sbyte y = x - 1; Console.WriteLine(y);
Which keyword is used to create a constant variable in C# that cannot be modified after initialization?
Which of the following correctly demonstrates nullable type syntax in C#?
Which access modifier provides access within the same assembly only?
What will be the output of: int x = 10; int y = 20; int z = x > y ? x : y; Console.WriteLine(z);
How many dimensions does a jagged array have in the following declaration: int[][] arr;