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 1");
myArrayList.Add("World 2"); //分别在1,2,插入Jack&this is the
myArrayList.Insert(1, "Jack 1");
myArrayList.Insert(2, "this is the 2"); Console.WriteLine("Capacity{0}:", myArrayList.Capacity);
//为什么会输出的Capacity的值是6呢?
Console.WriteLine("Count{0}", myArrayList.Count); Console.WriteLine(myArrayList[0]);
Console.WriteLine(myArrayList[1]);
Console.WriteLine(myArrayList[2]);
Console.WriteLine(myArrayList[3]); Console.ReadLine();
}
}
}
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 1");
myArrayList.Add("World 2"); //分别在1,2,插入Jack&this is the
myArrayList.Insert(1, "Jack 1");
myArrayList.Insert(2, "this is the 2"); Console.WriteLine("Capacity{0}:", myArrayList.Capacity);
//为什么会输出的Capacity的值是6呢?
Console.WriteLine("Count{0}", myArrayList.Count); Console.WriteLine(myArrayList[0]);
Console.WriteLine(myArrayList[1]);
Console.WriteLine(myArrayList[2]);
Console.WriteLine(myArrayList[3]); Console.ReadLine();
}
}
}
谢谢您!~
谢谢您!
我懂了哈!~