title: How to load data into array?
body: <p>There is a section in my assignment where I have to load these items into an array using a constructor and helper method. This is what it asks exactly:</p>
  
  <p><em>The Warehouse class contains an array of inventory Items that are currently in stock. The array is populated using a helper method that loads the data.</em> </p>
  
  <p><em>The Warehouse class will have 2 instance variables: the number of inventory items and an array to hold the inventory items. Assume that the maximum number of types of items is 60. You will need to add this information to the class.</em></p>
  
  <p><em>The constructor will be used to initialize these variables by loading the data that is hardcoded and included in the class.</em> </p>
  
  <p>How can go about doing this? This is what I have so far:</p>
  
  <pre><code> public class Warehouse
  
   //instance variables
   {private int numOfInvItems;
   private int inventoryItems[] = new int[60];
  
   //the constructor
   public Warehouse ()
   {numOfInvItems = 5;
   inventoryItems = new int[]{0,0,0,0,0};
  
   }
  
  
  //helper method
  /**
   * This is the hardcoded data to be loaded into the instance variables.  
   */
  public int loadData()
  {
  
      //("A11111", "Widgets", 30, 50, 70, 2.50, 20, 50);
      //("B22222", "Gadgets", 10, 20, 0, 4.00, 50, 100);
      //("C33333", "Trinkets", 100, 20, 35, 3.75, 80, 150);
      //("D44444", "Pickets", 0, 100, 20, 8.35, 25, 75);
      //("E55555", "Sockets", 200, 300, 150, 1.00, 200, 400);
      // number of items is 5;
  
      return 0;
  }
  }
  </code></pre>