class Persoana
{
public string name;
public Persoana[] children;
Persoana(string nume, Persoana[] copii) {
this.name = name;
this.children = children;
}
public override string toString() { //what is wrong in this function?
string temp = null;
for (int i = 0; i < this.children.Length; i++)
temp = temp + this.children[i].name; //I don' know how to do it with a string.join in this case
return string.Format("Parent name: {0} Number of children: {1} Children: {2}", name, children.Length);
}
}
答案 0 :(得分:1)
我认为你需要输入'String',而不是'string'。