Program to implement STACK and its operations
A Stack is a linear data structure in which all insertions or deletions are takes place at only one end rather than in the middle. This end is called as top of stack. For example – a stack of coins, a stack of plates. As the elements are inserted (added) or deleted (removed) from one end only it is called as FILO (First In Last Out) or LIFO (Last In First Out) lists. If stack is full (no space for new element) and we are inserting new element then such condition is called as Stack Overflow . If stack is empty (no element in stack) and we are deleting an element at top of stack then such condition is called as Stack Underflow . This program demonstrate the operations on STACK. When the new element is added in Stack then value of "top" is incremented by 1 and if we delete an element from Stack then the value of "top" is decremented by 1. PROGRAM import java.util.Scanner; class MyStack { private final int MAX_SIZE...