Null Reference Exception for Class Lists
<p>I am new to programming and am running into an issue when creating a class with a list property of another class and then accessing it in main. I am getting the exception "Object reference not set to an instance of an object" after trying to Add an item to the list I get this error during runtime. I do understand that the List&lt;> reference is null but am trying to understand why it is null and how to get around it. My code will function properly if I just create the List in main but I would like to have it as a class in the future. Like I said I am new to programming OOP and trying to get some information regarding why this is happening. I apologize if this is a repeat question. My code snippet is below:</p>

<pre><code>static void Main(string[] args)
    {
        BookList myBookList = new BookList();

        myBookList.bookList.Add(new Book("The Giver", "Lois Lowry", "Houghton Mifflin"));
        myBookList.bookList.Add(new Book("Telling Lies", "Paul Ekman", "Norton &amp; Company"));
    }


class BookList
{
    public List&lt;Book&gt; bookList { get; set; }
}

class Book
{
    public Book(string title, string author, string publisher)
    {
        Title = title;
        Author = author;
        Publisher = publisher;
    }

    public string Title { get; set; }
    public string Author { get; set; }
    public string Publisher { get; set; }        
}
</code></pre>

<p>Thank you, I appreciate all the help!</p>