Q: What is the value of the expression m &= 7 after it is executed in Java, where m is initially 15?
A
Answer:
A
Explanation:
The bitwise AND assignment operator (&=) in Java performs a bitwise AND operation between the variable on the left-hand side and the value on the right-hand side and assigns the result to the variable. In this case, m &= 7 is equivalent to 00001111 & 00000111, resulting in 00000111, which is 7 in decimal.
Related Topic:
Share Above MCQ