An Exercise
public class Bag
{
     private int[ ] data;
     private int manyItems;
     ...
}
One solution:
This is not the only solution.  You might have used different names for the two private instance variables. The important idea is that a private instance variable can be an array.

There’s at least one other facet that I should methion. The data array must be allocated as part of the constructor’s work. The initial size of the array is not too important, but the add method must keep an eye on this size and increase the size of the array as needed. This is accomplished through several methods in Section 3.2.