C# DataStructure2
class 成員 的 get set
class Pet { public string Name { get; set; } public int Age { get; set; } } public static void Ex1() { Pet[] pets = { new Pet { Name="Barley", Age=8 }, new Pet { Name="Boots", Age=4 }, new Pet { Name="Whiskers", Age=1 } };
}
Array 長度
int[] a = new int[5];int l = a.Length; => l=5
留言
張貼留言