Difficulty: Easy
Correct Answer: 1, 3, 5
Explanation:
Introduction / Context:C# divides types into value types (stack-allocated semantics) and reference types (heap-allocated semantics). Recognizing which common types are value or reference is foundational.
Given Data / Assumptions:
Concept / Approach:All numeric primitives (except decimal’s special handling) are value types: int, float (Single), long, etc. Arrays and string are reference types. Therefore, among the listed items, Integer, Single, and Long are value types.
Step-by-Step Solution:
Check Integer (int): value type → include. Check Array: reference type → exclude. Check Single (float): value type → include. Check String: reference type → exclude. Check Long (long): value type → include.Verification / Alternative check:System.ValueType is the base for int, float, long, etc., while arrays derive from System.Array and string is System.String, both reference types.
Why Other Options Are Wrong:They either include Array/String or omit one of the numeric value types.
Common Pitfalls:Assuming arrays are value types because their elements can be value types; the array itself is always a reference type.
Final Answer:1, 3, 5
Discussion & Comments