易顺金
大脑经常短路,陷入死循环。
摘要: namespace staticpublic{ /* 静态构造函数不能显示调用不带访问修饰符不带参数系统自动调用*/ class Test { public static string strstatic; public string strinstence; public Test(string str)//2调用静态构造函数 ,4运行构造函数 { strinstence = str; } static Test()//3先运行静态构造函数 { ... 阅读全文
posted @ 2012-07-08 16:07 易顺金 阅读(191) 评论(0) 推荐(0) 编辑
摘要: /*this,base调用构造函数 多态 里氏替换原则 子类可以赋值给基类 基类可以把指向的对象转换为对应的子类 虚方法 语句 */namespace ConsoleApplication2{ class Vehicle { //两个字段,属性一个构造方法 string _brand; string _color; public string Brand { get { return _brand; } } public string Color ... 阅读全文
posted @ 2012-07-08 08:55 易顺金 阅读(213) 评论(0) 推荐(0) 编辑