Stack
Stack is available since Java 1.0
Generally stack is a Data Structure worked on LIFO (Last In First Out) principle.
Stack class extends Vector class.
Stack has only one constuctor:
Stack()
Stack has following methods:
empty()
It return a boolean value whether stack is empty of not.
peek()
It returns the item at the top in the stack.
pop()
It returns and remove the item at the top in stack.
push(E item)
It pushes an item at the top in the stack.
search(Object o)
return the position of an item in the stack.
Generally stack is a Data Structure worked on LIFO (Last In First Out) principle.
Stack class extends Vector class.
Stack has only one constuctor:
Stack()
Stack has following methods:
empty()
It return a boolean value whether stack is empty of not.
peek()
It returns the item at the top in the stack.
pop()
It returns and remove the item at the top in stack.
push(E item)
It pushes an item at the top in the stack.
search(Object o)
return the position of an item in the stack.