Given the following code:
Hashtable main = new Hashtable();
Hashtable inner = new Hashtable();
ArrayList innerList = new ArrayList();
innerList.Add(1);
inner.Add("list", innerList);
main.Add("inner", inner);
Hashtable second = (Hashtable)main.Clone();
((ArrayList)((Hashtable)second["inner"])["list"])[0] = 2;
Why does the value within the array change from 1 to 2 in the "main" Hashtable, as the change was made on a clone ?