Learn C# .Net MCQs
Prepare C# .Net MCQs (Multiple choice Questions) for exam and job interviews.
What is the output of Console.WriteLine(2 * 3 + 4);?
1) 10
2) 6
3) 8
4) Error
Answer : 10
Which of the following keywords is used to create a thread in C#?
1) start
2) run
3) Thread
4) new
Answer : Thread
What is the output of Console.WriteLine(5 == 5 && 5 != 3);?
1) true
2) false
3) Error
4) None of the above
Answer : true
Which of the following is true about value types in C#?
1) They are stored in heap
2) They can be null
3) They are stored in stack
4) None of the above
Answer : They are stored in stack
What is the output of Console.WriteLine("2" + 2);?
1) 22
2) 4
3) Error
4) None of the above
Answer : 22
Which of the following statements is true about delegates in C#?
1) They are used to declare methods.
2) They are used to invoke methods.
3) They are type-safe function pointers.
4) Both b and c
Answer : Both b and c
What is the output of Console.WriteLine(10 - 3 + 2);?
1) 9
2) 8
3) 7
4) Error
Answer : 9
Which of the following is used to define an abstract method in C#?
1) abstract void MyMethod();
2) void MyMethod() abstract;
3) MyMethod() abstract;
4) None of the above
Answer : abstract void MyMethod();
What is the output of Console.WriteLine("abc".IndexOf("b"));?
1) 1
2) 0
3) 2
4) Error
Answer : 1
Which of the following can be used to declare an indexer in C#?
1) public int this[int index] { get; set; }
2) public int Get(int index) { }
3) public int[] Indexer { get; }
4) None of the above
Answer : public int this[int index] { get; set; }