foreach: foreach (int h in a) //可以将数组读出来(自动遍历数组) { Console.WriteLine(h); } 等量代换: 用一种量(或一种量的一部分)来代替和它相等的另一种量(或另一种量的一部分). //需要有个中间变量来倒 int a = 3, b = 5; int c; c = a;
第一种定义: 如果对每一个类型为S的对象o1,都有类型为T的对象o2,使得以T定义的所有程序P在所有的对象o1都代换为o2,程序P的行为没有发生变化,那么类型S是类型T的子类型. 第二种定义: 所有引用基类的地方必须透明的使用其子类的对象.(Functions that use pointers or references to base classes must be able to use objects of derived classes without knowing it.) 第二种