&#62;You might think a compiler could do several optimizations here, and you'd be right. But you'd only be right if the compiler could reorder the terms in A + B + C, or even if it could apply the notion that (A + B) + C == A + (B + C). But it ain't so in Java, at least not when I last looked at it.<p>Except Java is statically typed, so it's possible for the compiler to <i>know</i> if f returns an int, and it can rearrange the expression given that knowledge.