java operators

just23
just23 used Ask the Experts™
on
can anyone explain me .please that line
result = (byte)(x | y);  
does?

Given this code, what is the value of the result variable if the bit pattern for 4 is 0000 0100 and the bit pattern for 7 is 0000 0111?
byte x, y, result;
x = 4;
y = 7;
result = (byte)(x | y);

Choose an option.

      0000 0011
      0000 0100
      0000 0111
      1000 0111
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial