public static void main(String args[]) ( Stack strStack = new Stack(); String str char ch for (int i = 0; i<10; i++) [ s
Posted: Fri Jul 01, 2022 5:34 am
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)