How does initializing inherited members inside base class constructor reduce the calls to…?
- by flockofcode
I’ve read that instead of initializing inherited members ( _c1 in our example ) inside derived constructor:
class A
{
public int _c;
}
class B:A
{
public B(int c)
{
_c = c;
}
}
we should initialize them inside base class constructor, since that way we reduce the calls to inherited members ( _c ):
class A
{
public…