title: Java Object Null Check for method
body: <p>I need to create a null check in this formula for the books[i] and I am not entirely sure how to go about this as I am not greatly familiar with null checks and very new at programming. Any and all help is much appreciated!</p>
  
  <pre><code>public static double calculateInventoryTotal(Book[] books)
  {
      double total = 0;
  
      for (int i = 0; i &lt; books.length; i++)
      {
          total += books[i].getPrice();
      }
  
      return total;
  }
  </code></pre>