January 11, 201610 yr 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.
January 11, 201610 yr Author 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
January 11, 201610 yr 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.
January 11, 201610 yr Author 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, 201610 yr by piamia
January 11, 201610 yr 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.
January 13, 201610 yr 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
Create an account or sign in to comment