How to input strings into a private List<>

  • Thread starter Thread starter MorenainHanoi
  • Start date Start date
M

MorenainHanoi

Guest
Can somebody help me how to input strings in a private List<Book> in the main method??

Thank you so much in advance.


-Morena



public class Librarian
{
private List<Book> bookList;

public void RegisterBook(List<Book> myRegisteredBook)
{
bookList = myRegisteredBook;
}
public List<Book> RegisteredBooks()
{
return bookList;
}
}

class Program
{
static void Main(string[] args)
{
Bok myBook = new Book();
string bookTitle;
string bookAuthor;
int PublishingYear;

Librarian newBook = new Libararian();
newBook.RegisterBook();//I need help here!!!
List<Book> newBooks = newBook.RegisteredBooks();

Continue reading...
 
Back
Top