日期:2014-05-18 浏览次数:20829 次
static ArrayList pArray = new ArrayList(); static void Main(string[] args) { pArray.Add("aaaa"); pArray.Add("bbbb"); pArray.Add("cccc"); pArray.Add("dddd"); testRefuse t = new testRefuse(); } public class testRefuse { private ArrayList arrList = new ArrayList(); public testRefuse() { arrList = pArray; arrList.Add("eeee"); arrList.Add("ffff"); Console.WriteLine("arrlist中的元素有:"); for (int i = 0; i < arrList.Count;i++ ) { Console.WriteLine("arrList[{0}]={1}",i,arrList[i]); } Console.WriteLine("pArray中的元素有:"); for (int i = 0; i < pArray.Count; i++) { Console.WriteLine("pArray[{0}]={1}", i, pArray[i]); } } }