0

Can someone explain this?

x=5; x=x&3; print x in a java program.

15th Apr 2020, 11:20 AM
Nuwan Thisara
Nuwan Thisara - avatar
3 Answers
+ 2
Nuwan Thisara , bitwise and "&" compare bit by bit the binary representation of both numbers and the bit on a certain position is set to 1 if the bits of that position of the numbers are 1, otherwise 0. Look at the code đŸ± https://code.sololearn.com/c741c5oygBj3/?ref=app
15th Apr 2020, 11:34 AM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
0
TheWh¡teCat 🇧🇬 Thank you. Got it. 🙏
15th Apr 2020, 11:38 AM
Nuwan Thisara
Nuwan Thisara - avatar
0
You are welcome Nuwan Thisara đŸ±
15th Apr 2020, 11:39 AM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar