Compound assignment operators for boolean

Why compound assignment operators for booleans like "&&=" or "||=" are not defined in JLS? Is there any particular reason, or were operators just inherited from C/C++ ?

If such operators were defined, they should have the same meaning as compound assignment operators like "+=" or "*=", that is,

boolean b =true;

b = b ||false;

should be equivalent to

boolean b =true;

b ||=false;

[633 byte] By [serdioaa] at [2007-11-27 10:53:42]
# 1

You're dreaming. Those operators do not exist in C or C++. These exist in C, C++, and Java for booleans:

&= |= ^=

ejpa at 2007-7-29 11:45:44 > top of Java-index,Developer Tools,Java Compiler...
# 2

that's what he said :)

He's wondering whether the only reason they don't exist is that they don't exist in C and C++...

He's apparently not versed in the actual meaning of operators && and || or he'd soon realise that it wouldn't make a lot of sense to have a compound operator with the same functionality.

jwentinga at 2007-7-29 11:45:44 > top of Java-index,Developer Tools,Java Compiler...