void display() { System.out.println("\nStack elements from top to bottom\n"); for(int i=top;i>=0;i--) System.out.println(st[i]); } boolean isFull() { return(top==5-1); } boolean isEmpty() { return(top==-1); } } class Stack { public static void main(String a[]) { Scanner sc=new Scanner(System.in); Stack1 s=new Stack1(); int el=0,ch=1; { System.out.println("\n1.PUSH\n2.POP\n3.DISPLAY\n4.EXIT"); System.out.println("ENTER YOUR CHOICE"); ch=sc.nextInt();
void display() { System.out.println("\nStack elements from top to bottom\n"); for(int i=top;i>=0;i--) System.out.println(st[i]); } boolean isFull() { return(top==5-1); } boolean isEmpty() { return(top==-1); } } class Stack { public static void main(String a[]) { Scanner sc=new Scanner(System.in); Stack1 s=new Stack1(); int el=0,ch=1; { System.out.println("\n1.PUSH\n2.POP\n3.DISPLAY\n4.EXIT"); System.out.println("ENTER YOUR CHOICE"); ch=sc.nextInt();
unit5_jwfiles.docx