/* This class serves two purposes - to demonstrate importin and using a prewritten class and to use arrays of classes. * This class uses the class Chips, which is in the food package. So, this file must be placed in the same directory * that contains the directory "food". That is, it should be placed at least one directory level above the class being imported. */ import java.util.Scanner; import food.Chips; //importing the Chips class we just wrote. class ManyChips { //array of objects Chips [] chipArray; //This just declares a reference to an array of Chips. public ManyChips(int num) { //creates an array of Chips objects of size num chipArray = new Chips [num]; // This creates an array of referneces to Chips objects. Scanner input = new Scanner (System.in); for (int i=0; i