What does --> means in Java?

TigerHix :
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.

shauryachats :

--> 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

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related