假设我有这个range
类:
var range = sheet.getRange("N11").getValue();
我喜欢使用Student
创建public class Student
{
public int StudentID { set; get; }
public string StudentName { set; get; }
public int Age { set; get; }
}
的集合:
Student
但我听说使用List
通常会更好:
List<Student> studentList2 = new List<Student>() {
new Student() { StudentID = 1, StudentName = "John", Age = 18 } ,
new Student() { StudentID = 2, StudentName = "Steve", Age = 15 }
};
我不明白为什么人们建议使用IList
代替IList<Student> studentList1 = new List<Student>() {
new Student() { StudentID = 1, StudentName = "John", Age = 18 } ,
new Student() { StudentID = 2, StudentName = "Steve", Age = 15 }
};
!
是否存在某种性能问题?它是可选的还是个人喜好?或者还有其他原因吗?