C# MCQ Test: C# MCQs - Practice Questions
1. What is the purpose of the 'base' keyword in C#?
2. What is 'nullable types' in C#?
3. What is the C# syntax for a for loop?
4. What is 'asynchronous programming' in C#?
5. What is 'method overloading' in C#?
6. In C#, what is the purpose of the 'StringBuilder' class?
7. What is 'dependency injection' in C#?
8. What is 'generics' in C#?
9. In C#, what keyword is used to create an instance of a class?
10. In C#, what keyword is used to define a class?
11. What is the purpose of the 'using' statement in C# when working with resources like files or database connections?
12. What is the purpose of the 'this' keyword in C#?
13. What is the purpose of the 'using' directive in a C# program?
14. How do you define a static method in a C# class?
15. Which C# keyword is used to handle exceptions?
16. Which C# data type is used to store a single character?
17. What is the purpose of the 'break' statement in a switch statement in C#?
18. Which of the following is a reference type in C#?
19. What is the purpose of the 'is' keyword in C#?
20. How do you define an array in C#?
21. Which C# operator is used to compare two values for equality?
22. In C#, what keyword is used to define a constant?
23. What is the C# operator for multiplication?
24. What is the C# syntax for a switch statement?
25. What is 'garbage collection' in C#?
26. What is the purpose of the 'interface' keyword in C#?
27. Which C# keyword is used to define a method in a class?
28. What is 'boxing' and 'unboxing' in C#?
29. Which C# data type is used to store decimal numbers with high precision?
30. In C#, how do you declare a constant variable?
31. What is the default access modifier for class members in C#?
32. Which C# keyword is used to indicate that a method can be overridden in a derived class?
33. How do you define a property in a C# class?
34. What is the purpose of the 'using' statement in C#?
35. What is 'tuple' in C#?
36. Which C# keyword is used to exit a loop prematurely?
37. What is the purpose of the 'volatile' keyword in C#?
38. What is a 'delegate' in C#?
39. What is the default access modifier for class members in C# if no access modifier is specified?
40. How do you define a constant value in C#?