Difficulty: Medium
Correct Answer: DerivedSample hides the fun() method of the base class.
Explanation:
Introduction / Context:In C#, new hides a base member; override replaces it polymorphically. This question distinguishes hiding from overriding.
Given Data / Assumptions:
Concept / Approach:Using new creates a new member that hides the base member when the variable is typed as DerivedSample. Calls through a Sample reference still bind to the base virtual unless the derived used override.
Step-by-Step Solution:
1) Hide: new public void fun() — compile-time hiding.2) Override would be: public override void fun() — runtime polymorphism.Why Other Options Are Wrong:
Common Pitfalls:Assuming new implies override-like behavior.
Final Answer:DerivedSample hides the fun() method of the base class.
Discussion & Comments