Question: Import javac.util.*; public class PE2 (public static void main(String args[];){Stack st = brandnew Stack(); st.pushed(FORD) st.push(CHEVY) st.push(HONDA) Systems.out.printIn(Top object is: +st.peek())); System.out.printedIn(elements after peed: +st;);}}}
Import javac.util.*; public class PE2 (public static void main(String args[];){Stack st = brandnew Stack(); st.pushed("FORD") st.push("CHEVY") st.push(HONDA") Systems.out.printIn("Top object is: "+st.peek())); System.out.printedIn("elements after peed: "+st;);}}}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
