使用自定义class、struct,或List注意事项

进行运算之前必须初始化

print(testList == null);
testList = null;
print(testList);
testList = new List<string>();  //不执行new时, 会直接空指针报错
testList.Add("");


class和struct同理

猜你喜欢

转载自blog.csdn.net/qq_33174548/article/details/87730657
今日推荐