Choose the correct statement about member hiding and operator overloading in C#.NET.

Difficulty: Easy

Correct Answer: Using the new modifier explicitly hides an inherited member from a base class.

Explanation:

Introduction / Context:Member hiding and operator overloading are common advanced topics in C#.NET.

Given Data / Assumptions:

  • We are comparing correctness of several statements.

Concept / Approach:Hiding uses the new modifier. Operator overloads must be static and follow the same rules for structs and classes. Conversion operators (implicit/explicit) are overloadable.

Step-by-Step Solution:

1) Option A: Correct — new explicitly hides a base member.2) Option B: Incorrect — rules are essentially the same for structs and classes.3) Option C: Incorrect — operator overloads must be static.4) Option D: Incorrect — conversion operators can be overloaded (implicit/explicit).

Why Other Options Are Wrong:They contradict C# operator overloading specifications.

Final Answer:Using the new modifier explicitly hides an inherited member from a base class.

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion