1,Array类型生成方式以及实际类型
private static void ArrayIntro() { String[] sa = new String[1]; Array a1 = Array.CreateInstance(typeof(String), new Int32[] { 1 }, new Int32[] { 0 }); Array a2 = Array.CreateInstance(typeof(String), new Int32[] { 1 }, new Int32[] { 1 }); Console.WriteLine(sa.GetType().ToString()); Console.WriteLine(a1.GetType().ToString()); Console.WriteLine(a2.GetType().ToString()); } //System.String[] //System.String[] //System.String[*]
2,Array 的维度---used Rank to 指示数组的秩.
private static void ArrayRankInfo(String name, Array a) { Console.WriteLine("Number of dimensions in "{0}" array (of type {1}): ", name, a.GetType().ToString(), a.Rank); for (int r = 0; r < a.Rank; r++) { Console.WriteLine("Rank: {0}, LowerBound = {1}, UpperBound = {2}", r, a.GetLowerBound(r), a.GetUpperBound(r)); } Console.WriteLine(); }
3,Array-----其他特性...