Re: base, derived objects
Chris Anderson <[email protected]> Thu, 3 May 2007 16:28:20 +0100
| Newsgroups | gmane.comp.windows.devel.dotnet.cx |
|---|---|
| Message-ID | <[email protected]> |
public Derived (<derived param list>) : base(pass appropriate params to base) {}
eg
public Base (int param1, string param2) {...}
public Derived (int p1, string p2, int p3) : base(p1,p2)
{
// do something additional with p3
}
________________________________
From: Discussion relating to the specifics of the C# and Managed C++ languages on behalf of Peter Osucha
Sent: Thu 03/05/2007 16:00
To: [email protected]
Subject: [DOTNET-CX] base, derived objects
I have an derived class 'Derived' and a base class 'Base' from which it
derives. I have a constructor for 'Derived' which contains arguments
for virtually all the properties in 'Base'. I could create a
constructor for 'Derived' which takes an object of type 'Base'.
However, I am wondering if there is any 'shorthand' for doing this
already built into the system.
Is there?
Peter
===================================
This list is hosted by DevelopMentorĀ® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
===================================
This list is hosted by DevelopMentorĀ® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com