We assume that input is a valid postfix and expect an operator .
else { String op1 = ( String ) s . Peek ( ) ; s . Pop ( ) ; String op2 = ( String ) s . Peek ( ) ; s . Pop ( ) ; s . Push ( " ( " + op2 + exp [ i ] + op1 + " ) " ) ; } }