B站追风少年:class Program
{
static void Main(string【】 args)
{
Person p = new Person();
p【0】 = new Person();
Console.WriteLine(p【0】);
Console.ReadLine();
}
}
class Person
{
private Person【】 frides;
public Person this【int index】
{
get
{
return frides【index】;
}
set
{
frides【index】 = value;
}
}
}
为什么我这么写的,运行起来提示friends为null 报错呢?