How should I use List<Data> dat = new List<Data>(); to temporary store data in my software? "Data" is a class in my code with variables(mainly Strings). When I try that method it doesn’t store data.
How should I use List<Data> dat = new List<Data>(); to temporary store data in
Share
Listis an interface, so you can’t instantiate it (callnew List()) as it does not have a concrete implementation. To keep it simple, use one of the existing implementations, for example:You can then use it like this:
You would probably benefit from reading the Java Tutorial on Collections.