ch1_11.cs
来自「《c#技术内幕代码》」· CS 代码 · 共 35 行
CS
35 行
using System;
using System.Collections;
class CH1_11 {
public static void Main()
{
ArrayList al = new ArrayList(5);
// Add three elements to the end of the array
al.Add( 10 );
al.Add( 9 );
al.Add( 8 );
// Now, insert three elements in the front of the array
al.Insert( 0, 1 );
al.Insert( 0, 2 );
al.Insert( 0, 3 );
// Finally, insert into some random spots
al.Insert( 2, 4 );
al.Insert( 4, 5 );
al.Insert( 6, 6 );
// Enumerate the array
foreach ( int i in al )
{
Console.WriteLine( "Entry {0}", i );
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?