2.
Bitwise Operators – Guess the output
(Can run and check code here – https://groovy-playground.appspot.com/)
int a = 20
int b = 25
print (a & b)
hint: Convert 20 and 25 to their binary form
println Integer.toBinaryString(20) // 10100
println Integer.toBinaryString(25) // 11001
Apply & operation
10100
11001
———-
10000
Covert back to Integer
println Integer.parseInt("10000", 2)
(to the base 2 or decimal base)