program.cs
来自「这是.net2005学习不可缺少的教程」· CS 代码 · 共 35 行
CS
35 行
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace Array2
{
class Program
{
static void Main(string[] args)
{
// 使用Array
String[] firstArray ={ "how", "do", "you","do"};
for(int count=0;count<firstArray.Length;count++)
{
Console.WriteLine("{0} - Type:{1}",firstArray.GetValue(count),firstArray.GetValue(count).GetType());
}
Console.WriteLine("Type of firstArray is {0}", firstArray.GetType());
// 使用ArrayList
ArrayList secondArray = new ArrayList();
secondArray.Add("锄禾日当午");
secondArray.Add("汗滴禾下土");
secondArray.Add(36);
secondArray.Add(true);
for (int i = 0; i < secondArray.Count; i++)
{
Console.WriteLine("{0}\tType:{1}", secondArray[i], secondArray[i].GetType());
}
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?