c#中ArrayList 具体怎么用啊?

s2003010336 2007-11-01 11:04:42
刚开始学,书上说得很简单,不知道具体怎么用

我刚开始学,深奥的不懂。。。。
...全文
166 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
downmoon 2007-11-02
  • 打赏
  • 举报
回复
看MSDN
C#
using System;
using System.Collections;
public class SamplesArrayList {

public static void Main() {

// Creates and initializes a new ArrayList.
ArrayList myAL = new ArrayList();
myAL.Add("Hello");
myAL.Add("World");
myAL.Add("!");

// Displays the properties and values of the ArrayList.
Console.WriteLine( "myAL" );
Console.WriteLine( " Count: {0}", myAL.Count );
Console.WriteLine( " Capacity: {0}", myAL.Capacity );
Console.Write( " Values:" );
PrintValues( myAL );
}

public static void PrintValues( IEnumerable myList ) {
foreach ( Object obj in myList )
Console.Write( " {0}", obj );
Console.WriteLine();
}

}


一些resource:
http://www.wujianrong.com/archives/2006/11/arraylist.html
http://msdn2.microsoft.com/en-us/library/system.collections.arraylist.aspx
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1615824&SiteID=1

111,131

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧