public interface IStack<T>
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear the stack
|
default boolean |
isEmpty()
Tests if stack is empty
|
T |
peek()
Check element on top of the stack
|
T |
pop()
Removes the object at the top of this stack
and returns that object as the value
|
void |
push(T element)
Pushes an item onto the top of this stack
|
int |
size()
Returns the number of items in this stack
|
T[] |
toArray(Class<T[]> type)
Converts stack into the array,
ordered by the push order (the latest items are the first in array)
|
void push(T element)
element - the item to be pushed onto this stackT peek()
T pop()
void clear()
int size()
default boolean isEmpty()
Copyright © 2020. All rights reserved.