Pergunta

When I try to use the xor operator:

if(a ^ b)

I get the following error:

internal Error: unimplemented binary operator

Is there another way to do it in beanshell, or should I just do:

if((a && !b) || (!a && b))
Foi útil?

Solução

if(a != b) is equivalent to XOR (a ^ b) for booleans.

Outras dicas

In Beanshell2 the xor operator is implemented, see http://code.google.com/p/beanshell2

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top