listing stacks and queues continued ifoptop ='(thestack push(optop)breakelse int prec /if it' '(/restore '(/it' an operator /precedence of new op if(optop=='+|optop=='-'/find new op prec prec else prec if(prec prec /if prec of new op less /than prec of old thestack push(optop)/save newly-popped op breakelse /prec of new not less output output optop/than prec of old /end else (it' an operator/end while thestack push(opthis)/push new operator /end gotop(//public void gotparen(char ch/got right paren from input while!thestack isempty(char chx thestack pop()ifchx ='(/if popped '(break/we're done else /if popped operator output output chx/output it /end while /end popops(///end class intopost ///////////////////////////////////////////////////////////////class infixapp