Can I define constructor like this? Additional question: Can I call constructor of the class in itself constructor?
class SubArray
{
List<int> array;
string parent;
string name;
SubArray child;
public SubArray(SubArray child, string name)
{
this.child = child;
List<int> array = new List<int>();
this.name = name;
}
}
I guess you could do something like this and there is no....apparent problem:
There is no limit on that, but like any recursion - it needs a stopping condition. otherwise it will cause a stack overflow (PUN intended :)).