Remy Remy - 2 months ago 15
Java Question

Java certification: "& can have integral as well as boolean operands"

I'm reading a book of Hanumant Deshmukh preparing OCAJP, and I don't understand this:


& can have integral as well as boolean operands


Why is this true?

Answer

Because when used on integral types, it represents/means a bitwise and operation. This is a bitwise operation.

For more details see here:

http://docs.oracle.com/javase/tutorial/java/nutsandbolts/op3.html