[nem-pl] Dziedziczenie, i makra c.d.
Michal Moskal
malekith at pld-linux.org
Fri Mar 19 09:37:30 CET 2004
On Fri, Mar 19, 2004 at 03:47:00AM +0100, Pawel Rozanski wrote:
> Cześć,
> Czy można dziedziczyć konstruktor? a z klasy C#?
Konstruktorów się nie dziedziczy, ale można wywołać konstruktor klasy
bazowej.
Z grokking.html:
Static methods and the constructor are not derived. The parameterless
constructor is defined in this example. As the first thing to do, it
calls parameterless constructor of the base class. It does it, so the
derived fields are initialized first. Then it initializes the new
fields.
The call to the parameterless parent constructor is in fact
redundant. When there is no call to the parent class constructor,
such a parameterless parent constructor call is assumed in the first
line of a constructor.
Co do tych konstruktorów z polami (o których wspominał Kamil) to sprawa
czeka na wyjaśnienie.
--
: Michal Moskal :: http://www.kernel.pl/~malekith :: GCS !tv h e>+++ b++
: When in doubt, use brute force. -- Ken Thompson :: UL++++$ C++ E--- a?
More information about the devel-pl
mailing list