title: Null Pointer Exception in my for loop
body: <p>In my code there is a 'Null Pointer Exception' but  I can't seem to understand why. I've added the objects into the ArrayList in the constructor. When I try run the method, I get a Null Pointer Exception. Any help would be greatly appreciated.</p>
  
  <p>private ArrayList products;</p>
  
  <pre><code>//PRODUCTS CLASS CONSTRUCTOR
  
  Products(){ 
  
  
      ArrayList&lt;ProductsClass&gt; products = new ArrayList&lt;ProductsClass&gt;(); //Declaration and instantiation of ArrayList
  
      products.add(new ProductsClass("Bread", 0.65));
      products.add(new ProductsClass("Milk", 2.00));
      products.add(new ProductsClass("Pasta", 3.35));
      products.add(new ProductsClass("Milk chocolate bar", 0.75));
      products.add(new ProductsClass("Dark Rum", 25.00));
  
      ProductsClass p = products.get(3);
      System.out.print(p.getItemName() + ""); //Testing to see if works#
      System.out.print("");
      System.out.print(" " + p.getItemPrice());
  
  }
  
  public void findMatchingItem() {
  
      for (ProductsClass product : products) {
  
      System.out.print(product);
  
      }
  }
  </code></pre>