G
Guest
It's true that every time you add a new constructor to a parent class, you will need to modify the child class to be able to see it from there
Sample Code
public class Paren
public Parent(
// blank constructo
public int Cod
get{return this._code;
set{this._code = value;
private int _code = 0
public class Child : Paren
public Child() : base(
public class Teste
public Tester(
Child c = new Child()
c.Code = 10
Then, later I want to modify my Parent class to include a constructor that is going to receive a parameter, like this
// new constructo
public Parent(int i
this.Code = i
If I compiled all the classes, and if I try to modify my Tester class, I'm not able to see the new constructor, I'll need to add it to the child class like this
public Child(int i) : base(i
Why is that? Any other way to be able to modify my Parent classes without needing to modify all the inheritance layers?
Thank
Sample Code
public class Paren
public Parent(
// blank constructo
public int Cod
get{return this._code;
set{this._code = value;
private int _code = 0
public class Child : Paren
public Child() : base(
public class Teste
public Tester(
Child c = new Child()
c.Code = 10
Then, later I want to modify my Parent class to include a constructor that is going to receive a parameter, like this
// new constructo
public Parent(int i
this.Code = i
If I compiled all the classes, and if I try to modify my Tester class, I'm not able to see the new constructor, I'll need to add it to the child class like this
public Child(int i) : base(i
Why is that? Any other way to be able to modify my Parent classes without needing to modify all the inheritance layers?
Thank