Work with Stack<T> (LIFO) in Java

Stack<Integer> intStack = new Stack<Integer>();
intStack.push(1);
intStack.push(3);
intStack.push(5);

int top = intStack.peek();
//top is 5
int first = intStack.pop();
//first is 5
int second = intStack.pop();
//second is 3
int third = intStack.pop();
//third is 1