X1369: ArrayStack - topValue

In this fourth problem, you will complete the topValue() method. This method returns the top element of the stack, WITHOUT removing it. Remember, the stack is stored in the instance variable (stack) you created in a previous problem. Worthy of note, a stack is a LIFO - last in, first out structure. You always add at one end of the linear structure and remove from the same end. You might want to look at the documentation for ArrayList to refresh your memory of how to use that class.

Your Answer:

Feedback

Your feedback will appear here when you check your answer.