toString

open override fun toString(): String

Returns a string representation of this stack containing the stack's current size.

For example, given a stack instance containing 4 items, the output of this method would be:

Stack(size=4)

Return

String representation of this stack.