using System;
using System.Collections;
//csc arraylist_deepwcopy_c.cs
namespace shallowcopy
{
public class simple
{
public void read(IEnumerable em, string sep)
{
foreach(object obj in em){Console.Write("{0}{1}",obj, sep); }
Console.WriteLine();
}
}
class test
{
public static void Main()
{
ArrayList myS = new ArrayList();
myS.Add("as");
myS.Add("un");
simple tt = new simple();
Console.WriteLine("--Original array--");
tt.read(myS, " ");
ArrayList myT = new ArrayList();
myT = (ArrayList)myS.Clone();
myT[0] ="do";
Console.WriteLine("--Cloned array--");
tt.read(myT, " ");
Console.WriteLine("--Value at [0] position--");
Console.WriteLine("\n read local {0} {1}",myS[0],myT[0]);
Console.ReadLine();
}
}
}