SHARE
TWEET

Null pointer exception on 'store.storeProducts[i]' line

Dettefin Jun 5th, 2014 224 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //interface
  2. //related variables
  3. Store store = new Store();
  4.  
  5. public void run()
  6. {
  7.         for (int i = 0; i < store.maxNumberOfProducts; i++)
  8.         {
  9.                 store.storeProducts[i] = new Product();
  10.         }
  11.  
  12. }
  13.  
  14. //end interface
  15.  
  16. //store
  17. //related variables
  18. int maxNumberOfProducts = 3;
  19. Product[] storeProducts;
  20.  
  21. //constructors
  22. // set and get methods
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top