for (int i = 99; i --> 0;) { System.out.println(i); }
Above code works, and has the exactly same result of
for (int i = 99; i >= 0; i--) { System.out.println(i); }
What does the syntax "-->" originally mean in Java? Since almost reachable search engines disallow special characters, I cannot seem to find the answer.
--> is not a new operator. It is just a conjunction of the operators -- and > . You first compare, and then decrement the variable. That is, i --> 0. becomes effectively i > 0; //Compare i--; //and decrement.
>> is arithmetic shift right, >>> is logical shift right. In an arithmetic shift, the sign bit is extended to preserve the signedness of the number. For example: -2 represented in 8 bits would be 11111110 (because the most significant bit has negative weight).
lang. String objects a and b are duplicates when a != b && a. equals(b) . In other words, there are two (or more) separate strings with the same contents in the JVM memory.
-->
is not a new operator.It is just a conjunction of the operators --
and >
.
You first compare, and then decrement the variable.
That is,
i --> 0
becomes effectively
i > 0; //Compare i--; //and decrement
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