I see an unfamiliar notation in the Android source code: *=
For example: density *= invertedRatio;
I am not familiar with the star-equals notation. Can somebody explain it?
In Java, the *=
is called a multiplication compound assignment operator.
It's a shortcut for
density = density * invertedRatio;
Same abbreviations are possible e.g. for:
String x = "hello "; x += "world" // results in "hello world"
int y = 100; y -= 42; // results in y == 58
and so on.
density *= invertedRatio;
is a shortened version of density = density * invertedRatio;
This notation comes from C.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With