“Success is the ability to go from one failure to another with no loss of enthusiasm.” - Winston Churchill
Originally posted by Jugal Hans:
A simple question for java gurus:
I would like to request some detailed explainaition on ++ and -- operator.
I know in the above case it will display 0
but it confuses me when used in for loop
1. In the above statement at what point, i will be incremented ?
2. If I want to see the value immediately after the change, then at what point should I execute the println method ?
Now if i++ in for loop is changed to ++i the output still remains the same.
So exactly at what point I can see the changed value ?
Thank You!
Saheed Adepoju<br />SCJP 1.4<br />SCJD (B&S..In progress)
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.