📄 program.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace Example9_14 {
class Program {
static void Main(string[] args) {
ArrayList myArrayList = new ArrayList(3);
myArrayList.Add("Hello ");
myArrayList.Add("World!");
//分别在索引值为1和2的地方插入“Jack”和“This is the”字符串
myArrayList.Insert(1, "Jack ");
myArrayList.Insert(2, "This is the ");
//分别输出myArrayList的容量和元素个数。
Console.WriteLine("Capacity: {0}", myArrayList.Capacity);
Console.WriteLine("Count: {0}", myArrayList.Count);
//输出myArrayList的4个元素。
Console.WriteLine(myArrayList[0]);
Console.WriteLine(myArrayList[1]);
Console.WriteLine(myArrayList[2]);
Console.WriteLine(myArrayList[3]);
Console.ReadLine();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -