Question

if I have two variables

boolean k = true;
boolean m = false;

what does the following do;

k &= m;
Was it helpful?

Solution

That's the compound assignment operator, which is equivalent to:

k = (boolean)(k & m);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top