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))
if(a != b)
is equivalent to XOR (a ^ b
) for booleans.
In Beanshell2 the xor operator is implemented, see http://code.google.com/p/beanshell2
精彩评论