سؤال

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top