1. Is there any operators that can be used with boolean data types?
I can only think of 13:
boolean a = x && y; boolean b = x || y; boolean c = x & y; boolean d = x | y; boolean e = x == y; boolean f = x != y; boolean g = x ^ y; boolean h = (x = y); boolean i = (x &= y); boolean j = (x |= y); boolean k = (x ^= y);
Wonder why they left out &&=. I really wanted it yesterday.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Originally posted by Stan James: Wonder why they left out &&=. I really wanted it yesterday.
Hmmm... interesting... So, if the left side is true, it will assign it to the right side. Otherwise, it will short circuit the expression. Sort of like this.
The real test expressions were long enough they did not read well as
bool = testone() && testtwo() && testthree();
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I can't renounce my name. It's on all my stationery! And hinted in this tiny ad: