Frage

if I have two variables

boolean k = true;
boolean m = false;

what does the following do;

k &= m;
War es hilfreich?

Lösung

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

k = (boolean)(k & m);
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top