Hi all, I need to know something about inheritence in C#. I have a class shown below:
Class BaseClass
{
public void X()
{
//Some code here
Y();
}
public void Y()
{
//Some code here
}
}
Now I want to create another class(ChildClass) which derived from BaseClass. The problem is that somehow I want to override Y() function in ChildClass, and when the base.X() function is called, I want X() function to use overridden Y() function in ChildClass.
Someone suggested me to use 'delegate' keyword for Y function when overriding. But, I am not quite sure that this is gonna work.
Is this possible? Any suggestions?