Review: the implementation of the IntegerStack

  • Previously, we implement an IntegerStack class with an array of Integer:

       public class IntegerStack implements Stack<Integer>
       {
           private Integer[] item;
           private int stackTop;
    
           public IntegerStack(int N)
           {
               item = new Integer[N]; // Create an array of Integer objects
               stackTop = 0;
           }
    
           ....
       }