I’m working on my very first project outside the college.
I have two classes. In first one I have a method which adds strings to an arraylist.
In the second class I would like to access the arrayList from the method in previous class, and get elements of it.
How could I do that ?
Thank you for helping.
Unless you’re using .NET 1.1 i would avoid
ArrayListsand use their strongly typed counterpartsList<T>.You need to make the method
publicin class 1. Then you can access it from class 2 if it isstaticor if you have an instance of class 1.For example: