Stack: LIFO,
the Stack is a deprecated interface we should use Deque interface. The implementation can use LinkedList or array
push, pop, peek, size(), isEmpty()
public static void main(String[] args){ Deque<Integer> stack = new LinkedList<>() ; stack.push(5); stack.push(3); System.out.println(stack.size()); //2 System.out.println(stack.pop()); //3 System.out.println(stack.peek()); //5 System.out.println(stack.isEmpty()); //false System.out.println(stack.pop()); //5 System.out.println(stack.isEmpty()); //true }