aspose file tools*
The moose likes Beginning Java and the fly likes pre ++ or pre -- Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "pre ++ or pre --" Watch "pre ++ or pre --" New topic
Author

pre ++ or pre --

patrick van merchtn
Greenhorn

Joined: Apr 04, 2007
Posts: 9
post increment or post decrement is clear, but I am still confused about what the result is and when to use pre increment or pre decrement.
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
You can post questions, codes regarding where you miss, how the things are going on!




Regards,
cmbhatt


cmbhatt
patrick van merchtn
Greenhorn

Joined: Apr 04, 2007
Posts: 9
no problem, I find it myself. I think it was clear enough.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39436
    
  28
There is a simple answer about pre-increment and pre-decrement if you are confused about them. Don't use them.
Try this silly little code snippetSee what you get. Now repeat the whole exercise with ++i instead of i++.

Can you work out why you get different results? There is more in the Java Tutorial.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: pre ++ or pre --