wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes The ++ and – Operators Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "The ++ and – Operators" Watch "The ++ and – Operators" New topic
Author

The ++ and – Operators

Mathew Lee
Ranch Hand

Joined: Jun 08, 2009
Posts: 238
I was looking at following link on The ++ and – Operators
http://www.jchq.net/certkey/0501certkey.htm

>>>This is because the ++ is placed after the number 1, and thus the incrementation (the adding of 1) will occur after the line is run. The same principle is true for the – operator.

I clearly did not understood. Does it mean The ++ and –- Operators instead of The ++ and – Operators.

Any ideas, resources,sample code,links, highly appreciated. thanks in advance
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37943
    
  22
The bit about "after the line has run" is incorrect.
Look at these old thread, and the links in them: 1 2, and this FAQ.

As you will see, the ++ and -- operators cause no end of confusion.
 
Don't get me started about those stupid light bulbs.
 
subject: The ++ and – Operators
 
Similar Threads
shift operators
New guy with a problem
Best way of finding the bigdecimal is greater than 1 ?
Unary operator evaluation
question from Marcus Green's Mock Exam 3