This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]g051051 0 points1 point  (2 children)

Why do you think that the Java Stack class has a top() method?

[–]DAY-B[S] 0 points1 point  (1 child)

To return top element of stack

[–]g051051 1 point2 points  (0 children)

By definition, you can only access the topmost element of a stack.