Difficulty: Medium
Correct Answer: 2 only
Explanation:
Introduction / Context:
This item tests nuanced understanding of how C# organizes types into namespaces, including the special global namespace. It also addresses misconceptions about files and using directives.
Given Data / Assumptions:
Concept / Approach:
Examine each statement independently and compare it with C# language rules. The global namespace counts as a namespace context even when the code lacks an explicit namespace declaration.
Step-by-Step Solution:
Verification / Alternative check:
Create a class with no namespace and call it via its global name; the code compiles, demonstrating statements 1, 4, and 5 are misconceptions.
Why Other Options Are Wrong:
A and C include false statements; D claims a project-name default (not true); E includes the false requirement for using.
Common Pitfalls:
Equating project name with namespace and assuming files constrain namespace membership.
Final Answer:
2 only
Discussion & Comments