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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "using a++   and  a+1 ?" Watch "using a++   and  a+1 ?" New topic
Author

using a++ and a+1 ?

Anto Telvin
Ranch Hand

Joined: Aug 12, 2008
Posts: 113
hi all
why it is saying that a++ is faster than a+1 ?



thanks in advance


Anto Telvin Mathew<br />Many of the life failures are people who did not realize how close they were to success when they give up. EDISON
Bupjae Lee
Ranch Hand

Joined: May 14, 2007
Posts: 107
SUN JDK javac 1.6.0_07 compiler generates bytecodes like below:



It is true that a++ is slightly faster than a=a+1, but I think there are not that much difference.
Anto Telvin
Ranch Hand

Joined: Aug 12, 2008
Posts: 113
thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: using a++ and a+1 ?
 
Similar Threads
count yourself in javaranch#~
How many rotations...
Are there any Parsi guys on JR?
0 or 1
Portal and portlet developement forum