- Public Static Void Main String Args Stack Strstack New Stack String Str Char Ch For Int I 0 I 10 I S 1 (20.01 KiB) Viewed 35 times
public static void main(String args[]) ( Stack strStack = new Stack(); String str char ch for (int i = 0; i<10; i++) [ s
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
public static void main(String args[]) ( Stack strStack = new Stack(); String str char ch for (int i = 0; i<10; i++) [ s
public static void main(String args[]) ( Stack strStack = new Stack(); String str char ch for (int i = 0; i<10; i++) [ str = JOptionPane.showInput Dialog("Enter an alphabet"); ch str.charAt(0); if(! (ch == 'u')) [ || ch == 'e' ||ch == '1'||ch == strStack.push(str); System.out.print (str } } //DIAGRAM #1 System.out.printin(); for (int i=0; i <strStack.size(); 1+ 3) strStack.pop(); //DIAGRAM #2 while (!strstack.isEmpty()) System.out.println(atrstack.pop()); end of main d) Draw the TWO diagram of strStack to show its content when the program executes at DIAGRAM #1 and DIAGRAM #2. (4 marks)