What Does “––>” Mean in Java?

1 min read
Date: 2023-12-10
The Java expression (i-- > 0)
combines a post-decrement operator (--
) with a greater-than comparison (>
). It evaluates to true
if i
is greater than 0 before decrementing i
. This is commonly used in loops to iterate backward, processing elements in reverse order until a condition is met (e.g., i
reaching 0). The post-decrement means the final value of i
will be -1 after the loop completes. This construct offers concise control over loop iterations in various scenarios.
Read more: https://examples.javacodegeeks.com/minus-minus-greater-check-in-java/
0
Subscribe to my newsletter
Read articles from Yatin B. directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
