QWhat is the value of the expression m &= 7 after it is executed in Java, where m is initially 15?
Question Info
Choose the Best Option
Click any option to instantly check if you're correct.
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.
Want to remember what you got wrong?
Create a free account in seconds to track your score, revisit mistakes and continue Java Programming Language where you left off.
- Save your progress & streak
- Topic-wise quizzes & scores
- Bookmark tricky questions
- Printable MCQ sets
Nice — 3 questions done!
Don't lose this streak. Sign up free to save your score and pick up exactly where you stopped.
Share This Question
Challenge a friend or share with your study group.