You can use a List to keep a list of classes (or any number of different collections).
To do so, you could do something like this:
List<releaseitem> myList = new List<releaseitem>()
{
new releaseitem("ARTIST", "TRACK 01", "2014"),
new releaseitem("ARTIST", "TRACK 02", "2016"),
new releaseitem("ARTIST", "TRACK 03", "2012"),
new releaseitem("ARTIST", "TRACK 04", "2011")
};
foreach (releaseitem item in myList)
item.getDelails();
You would of course need a UI of some sort, or at least a way to add new items to your list, but that could look like:
releaseitem newReleaseItem = new releaseItem("entered artist", "track number", "year");
myList.Add(newReleaseItem);
also note, you should keep data types as similar to their data as possible, like year
should probably be an int
, if not an actual datetime
for the release date that you could extract the year from.
solved List all class objects