listing stacks and queues continued system out printpeekn( )system out print(')system out println("")///end class stackx ///////////////////////////////////////////////////////////////class parsepost private stackx thestackprivate string input//public parsepost(string sinput //public int doparse(thestack new stackx( )/make new stack char chint jint num num interansfor( = <input length() ++/for each charch input charat( )/read from input thestack displaystack(""+ch+")/*diagnosticif(ch >' &ch <' '/if it' number thestack push(int)(ch-' ')/push it else /it' an operator num thestack pop()/pop operands num thestack pop()switch(ch/do arithmetic case '+'interans num num breakcase '-'interans num num