title: Creating an Object array from another class
body: <p>Okay this should be simple. But I have been at this for a good hour and cannot figure out why its a nullpointerexception.</p>
  
  <p>I need to create an array for "Sally" and then test its length, which should be 0. This is in the main method of the driver class.</p>
  
  <pre><code> LendingItem[] sallysItemList = sally.getSignedOutItems();
  if (sallysItemList.length == 0)
  </code></pre>
  
  <p>and this is in the object class that created sally. that rotten B. </p>
  
  <pre><code>    private LendingItem[] signedOutItems;
  
  public LendingItem[] getSignedOutItems() {
      return signedOutItems;
  }
  </code></pre>
  
  <p>I feel like I need to maybe declare the Lending item as</p>
  
  <pre><code>private LendingItem[] signedOutItems = {};
  </code></pre>
  
  <p>but I still get errors with that also.</p>
  
  <p>EDIT:</p>
  
  <p>Im going to add more so that its more understandable what I need to make happen</p>
  
  <p>Provided code below.</p>
  
  <pre><code>   System.out.println("\n*** Test case #1: Create a CardHolder object &amp; test accessors");
  CardHolder sally = new CardHolder("Sally Smith",
                                    152,
                                    "454-1234");
  System.out.println("Name:     " + sally.getName()
                 + "\nAppt #:   " + sally.getAptNumber()
                 + "\nPhone:    " + sally.getPhoneNumber()
                 + "\nMember #: " + sally.getMembershipNumber());
  
  LendingItem[] sallysItemList = sally.getSignedOutItems();
  if (sallysItemList.length == 0)
    System.out.println("Correct result: Sally has zero lending items.");
  else
    System.out.println("&gt;&gt; ERROR: Sally has more than zero lending items.");
  
  
   System.out.println("\n*** Test case #6: Sign out one LendingItem");
  
  if(sally.signOut(testItemList[0]))
  { System.out.println("Correct result: Sally signed out an item successfully.");
    sallysItemList = sally.getSignedOutItems();
    if (sallysItemList.length == 1)
      System.out.println("Correct result: Sally has one lending item.");
    else
      System.out.println("&gt;&gt; ERROR: Sally has other than one lending item.");
  }
  else
    System.out.println("&gt;&gt; ERROR: Sally was unable to sign out an item.");
  </code></pre>
  
  <p>This is my code thus far.
  Just need to return the current signed out items.</p>
  
  <pre><code>    public LendingItem[] getSignedOutItems() {
      return signedOutItems;
  }
  </code></pre>
  
  <p>This is how we are expected to add to our array, it needs to return a boolean</p>
  
  <pre><code>    public boolean signOut(LendingItem lendingItem) {
      if (signedOutItems.length &lt; 7) {
          signedOutItems[0] = lendingItem;
          return true;
      } else {
          return false;
      }
  </code></pre>
  
  <p>Dont need the outright code just an idea of how to actually accomplish this.</p>