.top() method returns the top element on the
stack. This will be the most recently added element on the
stack since they follow a last-in first-out (LIFO) insertion order.
.top() method can be called on a
stack using the following syntax:
The following example calls the
.top() method to print successive entries from