for AND and OR operation
else if ( s . size ( ) == 5 ) { int a = s . get ( 0 ) - 48 , b = s . get ( 4 ) - 48 , c ; if ( s . get ( 2 ) == ' & ' ) { c = a & b ; } else { c = a | b ; } arr . push ( ( char ) ( c + 48 ) ) ; } } else { arr . push ( str . charAt ( i ) ) ; } } return arr . peek ( ) ; }