正在加载图片...
System Array和 System Co| lections. ArrayList的使用举例 WriteLine("Create an ArrayList type collection of Animal objects and use it: Arraylist animalArrayList new ArrayList o Cow my Cow2= new Cow(Rual") animalArrayList. Add (my Cow2) animalArrayList. Add (new Chicken( Andrea ) foreach (Animal myAnimal in animalArrayList) WriteLine($"New myAnimal. ToString(] object added to ArrayList collection, Name= fmy Animal Name]") WriteLine(s"ArrayList collection contains fanimalArrayList Count] objects. ((Animal)animalArrayList[o]). FeedO ((Chicken) animalArrayList[1]). LayEggo WriteLine oSystem.Array和System.Collections.ArrayList的使用举例
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有