Re: if derived class adds an argument to ctor, does that need to carry up to the base classes?
From: Ignacio Machin \( .NET/ C# MVP \) ("Ignacio)
Date: 08/19/04
- Next message: Ignacio Machin \( .NET/ C# MVP \): "Re: Input string not in correct format"
- Previous message: Dan Sikorsky: "HOWTO: Set this.Icon to App.ico in a windows form"
- In reply to: hazz: "if derived class adds an argument to ctor, does that need to carry up to the base classes?"
- Next in thread: hazz: "Re: if derived class adds an argument to ctor, does that need to carry up to the base classes?"
- Reply: hazz: "Re: if derived class adds an argument to ctor, does that need to carry up to the base classes?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 19 Aug 2004 16:27:25 -0400
"hazz" <hazz@sonic.net> wrote in message
news:O%23oM1bihEHA.636@TK2MSFTNGP12.phx.gbl...
> I have a class/constructor hiearchy that functions correctly as
illustrated
> below (thanks to Ken Kolda's earlier newsgroup assistance.) If a client
> instantiates object D, eg. D m_D = new D(str_arg), it climbs up the ctor
> stack until B(string str) handles it.
>
> A();
>
> B();
> B(string str)
> {
> do_string_Stuff; }
>
> C();
> C(string str) : base(str);
>
> D();
> D(string str) : base(str);
>
> Now for the change. I have a class that has this ctor signature.
> D ( long n_arg, string str) // :base(str) won't work anymore. will
> it have to be :base(n_arg, str)
It does has to work !
It will also work :this( str) which call the other constructor of D
Cheers,
-- Ignacio Machin, ignacio.machin AT dot.state.fl.us Florida Department Of Transportation
- Next message: Ignacio Machin \( .NET/ C# MVP \): "Re: Input string not in correct format"
- Previous message: Dan Sikorsky: "HOWTO: Set this.Icon to App.ico in a windows form"
- In reply to: hazz: "if derived class adds an argument to ctor, does that need to carry up to the base classes?"
- Next in thread: hazz: "Re: if derived class adds an argument to ctor, does that need to carry up to the base classes?"
- Reply: hazz: "Re: if derived class adds an argument to ctor, does that need to carry up to the base classes?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|