what is java stack
Java Collections - Stack. The java.util.Stack class deserves a little explanation on its own. In the text on the List interface the Stack class is listed as an implementation. The typical use of a Stack is not as a List though. A Stack is a data structure where you add elements to the top of the stack, and also remove elements from the top again. This is also referred to as the Last In First Out (LIFO) principle. In contrast, a Queue uses a First In First Out (FIFO) principle.