Abdul Ahmad
Abdul Ahmad

Reputation: 10021

boolean &= assignment operator meaning

if I have two variables

boolean k = true;
boolean m = false;

what does the following do;

k &= m;

Upvotes: 1

Views: 293

Answers (1)

Rohit Jain
Rohit Jain

Reputation: 213391

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

k = (boolean)(k & m);

Upvotes: 5

Related Questions