A list is an object in java and all lists must be created. When you declare a list such as:
you only created a pointer to a list, not the list itself. In this case, you create a pointer to a list l, and assign it a value of null. You must assign the pointer the value of a real list in order to use the list.