📄 program.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace Example9_13 {
class Program {
static void Main(string[] args) {
//创建一个ArrayList型变量myArrayList,并设置为只读
ArrayList myArrayList = new ArrayList(3);
ArrayList.ReadOnly(myArrayList);
//尝试向只读myArrayList中添加元素
myArrayList.Add("Hello ");
myArrayList.Add("World!");
Console.WriteLine("Capacity: {0}", myArrayList.Capacity);
Console.WriteLine("Count: {0}", myArrayList.Count);
Console.ReadLine();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -