[Solved] How to load data into array?


Here are some hints:

  1. Code the class that is going to represent an inventory item.
  2. It needs field, getters (and maybe setters) and a constructor
  3. The declaration of the array will look like this:

      private NameOfYourClass[] inventoryItems
    
  4. The initialization can look like this

          = new NameOfYourClass[] {
                 new NameOfYourClass(/* constructor arg list */),
                 new NameOfYourClass(/* constructor arg list */),
                 new NameOfYourClass(/* constructor arg list */)
          };
    

If that doesn’t make sense, please go back to your textbook, etc and READ.

9

solved How to load data into array?