Difficulty: Easy
Correct Answer: 1, 3, 5
Explanation:
Introduction / Context:
This item checks basic OO knowledge in C#. It tests how instance members are accessed, what a class can contain, object layout, access modifiers, and the conceptual role of a class.
Given Data / Assumptions:
Concept / Approach:
(1) True: Outside the class, you access instance members via an instance reference; inside, you use this (still an object). (2) False: classes can also have static members. (3) True: instances of the same class share the same layout, so each object of that class occupies the same number of bytes (ignoring runtime headers and GC internals which are uniform). (4) As written, “Friend functions” is a VB term; in C#, the equivalent is internal. The statement is not accurate in C# context. (5) True: class as blueprint/template is a standard definition.
Step-by-Step Solution:
Verification / Alternative check:
Review the C# language specification for member access and type members; instance size comes from the class’s field composition.
Why Other Options Are Wrong:
They include statement 2 or 4 which are not correct as stated.
Common Pitfalls:
Confusing C# keywords with VB’s; forgetting that static members exist and are not tied to instances.
Final Answer:
1, 3, 5
Discussion & Comments