Hey,
Say I have the following...
Say I have the following...
Code:
// Assume I dont have the source for this code/object/class
public parentClass() {
public doSomething() {
Console.Writeline("Parent Class: doSomething");
}
public doSomethingNew() {
Console.Writeline("Parent Class: updated doSomething");
}
}
// This is my code
public childClass() : parentClass() {
new public doSomethingNew() {
base.doSomethingNew();
Console.Writeline("Child Class: doSomethingNew");
}
}
public void main() {
childClass c = new childClass;
c.doSomethingNew();
c.doSomething(); // dont want this to be available!
}
[code]
...does this illustrate my quesetion? I want to be able to inherit from a base class (which has various methods and properties), but in some cases I need to "hide" member functions that my child class will probably utilize, but instantiated objects should not have available.
Does anyone know how I could do this?