扩展方法
必须在静态类中, 且必须是静态方法
public static class Extenstion{
public static int Count(this string str, 普通参数){
//this string 表示对string类进行扩展
}
}
string s = "";
s.Count(普通参数); //调用
初始化器
初始化的必须是public set的字段
var stu = new Student{Name = "s", Id = 0} //调用空构造函数
var stu2 = new Student("s"){Id = 0} //调用含参构造
(并不是严格的代码, 只是保留框架)