Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Compound assignment operators for boolean

843810Jul 18 2007 — edited Jul 31 2007
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;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 28 2007
Added on Jul 18 2007
6 comments
446 views