Re: Inheritance question
- From: Jon Skeet [C# MVP] <skeet@xxxxxxxxx>
- Date: Sun, 12 Feb 2006 07:51:54 -0000
relient <xllx.relient.xllx@xxxxxxxxx> wrote:
Oh, yes... One last thing I forgot to say above (which was my primary
question; hehe) is: override and abstract in the same signature doesn't
make much sense to me. I mean, It's not like you can create an instance
of class "Derived" and assign it to a variable of type class Base, to
use in polymorphism, because it's abstract. I do, however, understand
if it was "new abstract" but, "override abstract"? what's up with that
confusing signature?
It's not that confusing - it basically means that the derived class
*has* to implement the method, and it's an override so that if someone
has:
Base b = new Third();
b.DrawYourself();
it will still call the overridden method in Third. (If it were "new
abstract" in Derived, the above would call Base.DrawYourself.)
--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.
- References:
- Inheritance question
- From: relient
- Re: Inheritance question
- From: relient
- Inheritance question
- Prev by Date: Re: Inheritance question
- Next by Date: Carriage return
- Previous by thread: Re: Inheritance question
- Next by thread: Re: Inheritance question
- Index(es):
Relevant Pages
|