Stack using Interface in Java
import java.util.*; interface Stk { void push(int g); int pop(); boolean isempty(); boolean isfull(); int peek(); void disp(); }; class MyStack implements Stk { int ar[]; int top; MyStack(int p) { ar=new int[p]; top=-1; } public void push(int g) { ar[++top]=g; } public int pop() { int t; t=ar[top--]; return t; } public int peek() { int t; t=ar[top]; return t; } public boolean isfull() { if(top==ar.length) return true; else return false; } public boolean isempty() { if(top==-1) return true; else return false; } public void disp() { int t; t=top; while(t>=0) { System.out.println(ar[t]); t--; } } } class StackPrg { public static void main(String []ar) { Scanner sc=new Scanner(System.in); int t,ch,v; System.out.println(&qu