what is the difference between
class abc : qwe
{
}
and
class zxc : qwe
{
zxc() : base(new someAnotherclass()).
{
}
}
The difference is, that in your first code snippet you're calling the parameterless base class constructor, whereas in your second code snippet you're calling the base class constructor with a parameter.
Your base class might be defined as follows:
class qwe{
public qwe(){ /* Some code */ }
public qwe(SomeAnotherclass ac){ /* Some other code */ }
}
The default constructor for your abc
class looks exactly like the following:
class abc{
public abc() : base() {}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With