I want to create a List that holds a couple of books with the book title, authors name and year of publication. example: ( AuthorLastName, AuthorFirstName, “The book title”, year.)
I know how to create List<int>
, for example:
class Program
{
static void Main()
{
List<int> list = new List<int>();
list.Add(10);
list.Add(20);
list.Add(25);
list.Add(99);
}
}
But the problem is, if I want to create a list of books, I can't simply make a list<string>
or list<int>
because I want it to contain strings and int's (as the example above).
So, Can anyone explain how I can make a List of books?