Re: abstract class inheritance
From: Joerg Jooss (joerg.jooss_at_gmx.net)
Date: 09/10/04
- Next message: Dan: "Re: copy/paste from VS looks bad"
- Previous message: Dan: "Re: reading text into arrays"
- In reply to: Claire: "abstract class inheritance"
- Next in thread: Tom Porterfield: "Re: abstract class inheritance"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 10 Sep 2004 17:16:33 +0200
Claire wrote:
> I have a base abstract class A which contains several abstract
> functions
> I then have an abstract class B (derived from A) which overrides a
> small subset of A's abstract functions
>
> Finally I have a fully functional class C (deriving from B). Class C
> overrides the (A's) abstract functions not tackled by its ancestor B.
>
> I am complained at by the compiler, that in C, I have not implemented
> the inherited abstract members defined by A. But I overrode these
> functions in B!
>
> Is this correct and why?
>
> Claire
>
> public abstract class A
> {
> public abstract void Function1();
> public abstract void Function2();
> public abstract void Function3();
> }
>
> public abstract class B : A
> {
> public override void Function1()
> {
> doodar;
> }
> }
>
> public class C : B
> {
> public override void Function2()
> {
> }
> public override void Function3()
> {
> }
> // Compiler complains that C has not implemented Function1
> }
It should compile. And it actually does for me (.NET 1.1, VS .NET 2003).
Cheers,
-- Joerg Jooss joerg.jooss@gmx.net
- Next message: Dan: "Re: copy/paste from VS looks bad"
- Previous message: Dan: "Re: reading text into arrays"
- In reply to: Claire: "abstract class inheritance"
- Next in thread: Tom Porterfield: "Re: abstract class inheritance"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|