T
- data to keep in stackpublic class ArrayStack<T> extends Object
Constructor and Description |
---|
ArrayStack(int initSize)
Create
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
remove all items in the stack
|
boolean |
isEmpty()
Check
|
T |
pop()
Get the head and remove it from the stack
|
void |
push(T obj)
Add the element to the head
|
public ArrayStack(int initSize)
initSize
- - book the sizepublic void push(T obj)
obj
- - data to be addedpublic T pop()
public boolean isEmpty()
public void clear()
Copyright © 2008–2022. All rights reserved.