& : Java Glossary


Performs a bit-wise logical and, usually on two ints. It can also be used on booleans in logical expressions, though normally you use &&. && is sometimes called short circuit & or McCarthy &.

0b0101_0101 & 0b0001_11000b0001_0100

& logical AND is a logical carryless bitwise multiply, used for masking (getting rid of parts of a word you don’t want), 1s where both operands have a 1 otherwise 0. Don’t confuse this with &&.

0 & 00
0 & 10
1 & 00
1 & 11

& Tips

Here is how to and together an array of booleans:

This page is posted
on the web at:


Optional Replicator mirror
of mindprod.com
on local hard disk J:

Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

Your face IP:[]
You are visitor number