Program in Java
Create a stack class to store integers and implement followingmethods:
1- void push(int num): This method will push an integer to thetop of the stack.
2- int pop(): This method will return the value stored in thetop of the stack. If the stack is empty this method will return-1.
3- void display(): This method will display all numbers in thestack from top to bottom (First item displayed will be the topvalue).
4- Boolean isEmpty(): This method will check the stack and if itis empty, this will return true, otherwise false.