Stack class in Java is a special kind of data structure which can be thought a linear structure represented by physical stack or pile. In a stack data structure, we can perform the insertion and deletion of items. In this data structure, we can add or remove an element from the top of the structure.
Java Stack is the legacy Collection class. It extends the Vector class with five operations to support the LIFO(Last In First Out) operations. It is available in the Collection API since Java 1.0. As a Vector implements List, Stack class is also the List implementation class but does NOT support all the operations of Vector or List. As Stack supports LIFO, it is also known as LIFO Lists. Java is an Object-Oriented programming language as well all know.
#java #java stack class #programming