Consider this example.
We have a class called Control. Then we have a class inheriting that class, called CollectionControl. Finally, on top of all this, we have a class called ListBox that inherits CollectionControl.
Now, let’s say that Control has a method called “OnSizeChanged”, which is defined the following way:
internal protected virtual void OnSizeChanged(Vector size)
{
}
How would I override this method from ListBox?
If I can’t, what would be the best work-around?
Just use the
overridekeyword as usual. No special incantations are required for once-removed inheritance relationships.