Lab 09: Hint pop()
The stub of pop()
should look like this:
::pop() {
Item Stack}
Because pop()
is basically the complement of push()
, and the index of the top item is 1 position “down” from mySize
, the pop()
method should behave as follows:
- Subtract 1 from
mySize
. - Return the entry of
myArray
whose index ismySize
.