Thank Folks who <b>Make Sense</b> here.<br />SCJP Platform 2
Dave
Thank Folks who <b>Make Sense</b> here.<br />SCJP Platform 2
Dave
15.15.1 Prefix Increment Operator ++
A unary expression preceded by a ++ operator is a prefix increment expression. The result of the unary expression must be a variable of a numeric type, or a compile-time error occurs. The type of the prefix increment expression is the type of the variable. The result of the prefix increment expression is not a variable, but a value.
At run time, if evaluation of the operand expression completes abruptly, then the prefix increment expression completes abruptly for the same reason and no incrementation occurs. Otherwise, the value 1 is added to the value of the variable and the sum is stored back into the variable. Before the addition, binary numeric promotion (�5.6.2) is performed on the value 1 and the value of the variable. If necessary, the sum is narrowed by a narrowing primitive conversion (�5.1.3) to the type of the variable before it is stored. The value of the prefix increment expression is the value of the variable after the new value is stored.
Rob
SCJP 1.4
Rob
SCJP 1.4
Originally posted by geetha nagarajan:
As the while statement has a semicolon at the end,it doesn't function as a loop,right.
Originally posted by Ana P:
how can in while loop b++ calculates -128
binary value of 127 is
0111 1111
+ 1
-----------
1000 0000
pls explain...
Would you turn that thing down? I'm controlling a mind here! Look ... look at the tiny ad ...
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
|