Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#Actualjefferytitan

Posted 15 August 2012 - 10:42 PM

It's just count++, not count=count++. It's not better programming per se, just shorter. I don't use it the way you have, but if I recall correctly the return value of count++ is count, whereas the return value of ++count is count+1.

It makes more sense as below:
[source lang="java"]int count = 0;count++; // count is 1 after this++count; // count is 2 after thisint a = count++; // a is 2, count is 3 after thisint b = ++count; // b is 4, count is 4 after this[/source]

#1jefferytitan

Posted 15 August 2012 - 10:26 PM

It's just count++, not count=count++. It's not better programming per se, just shorter. I don't use it the way you have, but if I recall correctly the return value of count++ is count, whereas the return value of ++count is count+1.

PARTNERS