T
thechaosengine
Hi all,
Is there a way to hide a member in a subclass that has been inherited from a
base class?
Lets leave aside any issues regarding whether its a good idea for a moment.
Here's an example similar to what I'm thinking about.
Lets suppose I make a class called RoleCollection.
RoleCollection inherits and extends the functionality of ArrayList.
ArrayList implements a public method called RemoveAt().
I may want to guard against the user of my base class depending on that
method. Maybe i can't be arsed implementing it and just want to hide the
fact that it exists. I could return an OperationNotImplementedException or
something but I'm wondering if its possible to do method hiding.
Ok. Now you can flame me on what a bad idea it is.
Let the flaming scorn begin
tce
Is there a way to hide a member in a subclass that has been inherited from a
base class?
Lets leave aside any issues regarding whether its a good idea for a moment.
Here's an example similar to what I'm thinking about.
Lets suppose I make a class called RoleCollection.
RoleCollection inherits and extends the functionality of ArrayList.
ArrayList implements a public method called RemoveAt().
I may want to guard against the user of my base class depending on that
method. Maybe i can't be arsed implementing it and just want to hide the
fact that it exists. I could return an OperationNotImplementedException or
something but I'm wondering if its possible to do method hiding.
Ok. Now you can flame me on what a bad idea it is.
Let the flaming scorn begin
tce