Difficulty: Easy
Correct Answer: False
Explanation:
Introduction / Context:
This question checks basic knowledge of default values for built-in types in C#. Knowing defaults helps avoid uninitialized-variable bugs and supports correct struct/class field definitions.
Given Data / Assumptions:
Concept / Approach:
In C#, the default for bool is false. Numeric types default to 0 (or 0.0), reference types to null, and char to the null character. Local variables must be assigned before use, but their theoretical default is not usable without explicit assignment.
Step-by-Step Solution:
Verification / Alternative check:
Declaring a field in a class bool flag; and printing its value shows False unless explicitly set to true.
Why Other Options Are Wrong:
0/1 are numeric encodings, not the C# literal defaults. True is the opposite of the default. -1 is unrelated to bool.
Common Pitfalls:
Confusing C# with languages where boolean truth values map directly to 0/1 and may be treated as integers.
Final Answer:
False
Discussion & Comments