piamia Posted January 11, 2016 Share Posted January 11, 2016 (edited) ds Edited January 18, 2016 by piamia Quote Link to comment Share on other sites More sharing options...
Token Posted January 11, 2016 Share Posted January 11, 2016 A variable followed by ++ denotes an incrementation in most languages including Java. The opposite of incrementation is decrementation (--). As a side note, if you ever plan to write code, do it in english. In 7 years I've never written code in my native language and I'm not going to. Quote Link to comment Share on other sites More sharing options...
piamia Posted January 11, 2016 Author Share Posted January 11, 2016 A variable followed by ++ denotes an incrementation in most languages including Java. The opposite of incrementation is decrementation (--). As a side note, if you ever plan to write code, do it in english. In 7 years I've never written code in my native language and I'm not going to. I tried doing that once lol, my teacher told me to write in Swedish so she could understand It wouldn't really surprise me if she accused me of copying the code either, if it would of been in English Quote Link to comment Share on other sites More sharing options...
Token Posted January 11, 2016 Share Posted January 11, 2016 I tried doing that once lol, my teacher told me to write in Swedish so she could understand It wouldn't really surprise me if she accused me of copying the code either, if it would of been in English Just like your teacher tells you to write in Swedish so she can understand, the rest of the world will ask you to write in English so that they can understand. Quote Link to comment Share on other sites More sharing options...
piamia Posted January 11, 2016 Author Share Posted January 11, 2016 (edited) Just like your teacher tells you to write in Swedish so she can understand, the rest of the world will ask you to write in English so that they can understand. In this case what does cc++ do? I am aware that it increases by one. EDIT: nvm figured out. Edited January 11, 2016 by piamia Quote Link to comment Share on other sites More sharing options...
Token Posted January 11, 2016 Share Posted January 11, 2016 In this case what does cc++ do? I am aware that it increases by one. EDIT: nvm figured out. Just like you said. It increases by 1. cc++ is equivalent with cc = cc + 1. Quote Link to comment Share on other sites More sharing options...
matt123337 Posted January 13, 2016 Share Posted January 13, 2016 Token only explained half of the increment stuff, you can also do "++cc". The only real difference is that "cc++" returns the old value of cc, whereas "++cc" returns the incremented value. And example: int i = 5; System.out.println(++i); // increment i, then print value (6) // the variable i now equals 6 System.out.println(i++); // prints out value (6), then increments //the variable i now equals 7 Quote Link to comment Share on other sites More sharing options...