Single Choice Easy

QWhat is the value of the expression m &= 7 after it is executed in Java, where m is initially 15?

ID: #20171 Bitwise Operators 138 views
Question Info
#20171Q ID
EasyDifficulty
Bitwise OperatorsTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A 0 ✔ ✖
  • B 7 ✔ ✖
  • C 8 ✔ ✖
  • D 15 ✔ ✖
Correct Answer

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.

Today: 0 answered · 0 correct
Save progress
Free account

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
Practice smarterFree account · save progress
Sign up free

Share This Question

Challenge a friend or share with your study group.