222 total contributions
The .size() method returns the number of elements in the stack.
.size()
stack
The .size() method is called on a stack using the following syntax:
stackName.size();
The following example uses the .size() method on myStack:
myStack
usVisit uscodeHide codeCodeOutputHide outputHide outputLoading...Run
474 total contributions
271 total contributions