Akshay Mallabadi wrote:exactly i aggree with above 2 comments (comparing with Zero) but i needed some more detailed information regarding this, i thought zero is neither positive nor negative number hence the JVM takes a less time camparing any value to zero, rather than with other numbers ...
can any one provide still light on this .....?
This goes back to operations that are implemented in hardware. Math operations at the machine code level generate not only the result, but in the course, set some flags. Several of these flags are set depending on how the result compares to zero. So, you don't need an extra step to compare a number to zero, the flags are already set appropriately. Comparing to something other that zero, e.g. "i < 1000", usually requires that a subtraction be performed (i - 1000) and that the flag bits are tested after the subtraction.