Jump to content

Need Some Help and Improvements


Recommended Posts

Posted

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.

Posted

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 blink.png

It wouldn't really surprise me if she accused me of copying the code either, if it would of been in English 

Posted

I tried doing that once lol, my teacher told me to write in Swedish so she could understand blink.png

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.

Posted (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 by piamia
Posted

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

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...