There are two direct problems here, and one indirect.
1)
ArrayList
is not the same as
arrayList
- C# is case sensitive.
2) You declare arr as a local variable - which means it is scoped to the method in which it is declared. You cannot access it via the class instance, which is what
this
is there for.
ArrayList arr = new ArrayList(200);
arr.Add(obj);
The indirect problem is that ArrayList was superseded in V2 of C#, waaaay back in 2005 by Generic Collections, which are a lot better as they are typesafe. ArrayList should not be used in new projects.