Compiler bugs are quite rare. That's not to say they can't happen, just that they are highly unlikely, especially if the compiler is as widely used as javac. In 20 years I've had a single language for which the compilers were faulty due to their immaturity (HPF a.k.a High Performance Fortran, if you're curious). I've learned to double- and triple-check what I'm doing whenever I suspect a compiler bug, and -with the exception mentioned above- it always turned out to be me
Value of postincement in not available to current "statement" (ending with ; sign is a statement). So what ever is inceremnted will be effective in next statement. so if we have
in line 1 i is incremented. No probs here...BUT remember that incremented value is available from next statement onwards (thats the catch).
this is wht complier must be thinking... Compiler: Ok [line 1] I will increment i++ so my i is 1 now but this updated value will be available only to next statement NOT current statement. Compiler: Ok [line 1] I will assign the RHS to the LHS. RHS = i++ result=> value in current statement =>0 :. LHS = 0
Please correct me if I am wrong! Thanks! Rohit [ July 17, 2006: Message edited by: Rohit Kharat ]
posted 12 years ago
A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
Now you solve this statement with i=0. ****Remember 1) the box indicates a single statement. 2) posstincrement result is available to next statement not current one means in box 1 even if i is incremented it value will be 0 only withing the "box" statement.
I think once you go through this it should be clear I hope. Thx!
[ July 17, 2006: Message edited by: Rohit Kharat ] [ July 17, 2006: Message edited by: Rohit Kharat ]