Difficulty: Easy
Correct Answer: 1, 2, 5
Explanation:
Introduction / Context:This conceptual question distinguishes rectangular arrays (int[ , ]) from jagged arrays (int[][]) and asks about memory layout intuition and access to the base class System.Array APIs. Some statements are distractors about method access and adjacency guarantees.
Given Data / Assumptions:
Concept / Approach:Statement 1 is true by definition. For teaching purposes, statement 2 captures that a rectangular array is one contiguous rectangular block with rows laid out adjacently in the same object. Statement 5 correctly describes jagged arrays: each row is an independent inner array with potentially different lengths and nonadjacent addresses. Both kinds of arrays are instances derived from System.Array and thus inherit its methods; statements 3 and 4 are therefore false.
Step-by-Step Solution:
(1) True — C# supports both rectangular and jagged arrays. (2) True — a rectangular array is a single multi-dimensional object; rows are adjacent within that object. (3) False — jagged arrays still inherit System.Array members. (4) False — rectangular arrays also inherit System.Array members. (5) True — jagged arrays may have different row lengths and are separate inner objects, not one contiguous rectangle.Verification / Alternative check:Both forms expose Length, Rank (for rectangular), and methods like GetLength/GetUpperBound from System.Array.
Why Other Options Are Wrong:Any option including 3 or 4 is incorrect because it denies System.Array membership inheritance.
Common Pitfalls:Confusing the logical concept of adjacency in a rectangular array with physical memory guarantees, and thinking jagged arrays lose System.Array APIs.
Final Answer:1, 2, 5
Discussion & Comments