public class Stack<T> extends Object
Constructor and Description |
---|
Stack() |
Modifier and Type | Method and Description |
---|---|
void |
add(List<? extends T> values)
Adds all the values at the end of this stack.
|
void |
add(T value)
Adds a new value at the end of this stack.
|
void |
clear()
Clears the stack.
|
T |
get()
Gets the last element of the stack.
|
T |
getAndRemove()
Gets the last element of the stack and removes it.
|
void |
remove()
Removes the last element of the stack.
|
int |
size()
Returns stack size value.
|
public void add(T value)
value
- is a value to be added.public void add(List<? extends T> values)
values
- is a list of values.public T get()
null
if there are no elements.public T getAndRemove()
null
if there are no elements.public void remove()
public void clear()
public int size()
Copyright © 2008–2013. All rights reserved.