In Java Stack class is a child class of Vector class in collection framework.
Stack class represents a last-in-first-out (LIFO) stack of objects. It extends class Vector with five operations that allow a vector to be treated as a stack.
Java Stack data structure:
When to use Stack in Java? : Whenever last in first out order required then we should go for Stack in Java.
Hierarchy of Java Stack class: