1

Possible Duplicate:
What is the difference between += and =+?

I know what saying x+=1; means

but what does

saying x=+1; mean?

Community
  • 1
  • 1
James Andino
  • 22,903
  • 15
  • 52
  • 75

3 Answers3

13

There is no =+ operator. x=+1 simply means assign +1 (positive 1) to x.

casablanca
  • 68,094
  • 7
  • 131
  • 148
  • hurm It must be an odd contruct of the api I use, I assumed it was part of the Java Language because I know in C it is a post operator. – James Andino Aug 25 '10 at 05:47
  • @Doodle: There is no such operator in C either. The post-increment operator is `++`, which is present in Java as well. – casablanca Aug 25 '10 at 15:40
4

It assigns a value of +1 to variable x.

BalusC
  • 1,040,783
  • 362
  • 3,548
  • 3,513
0

x += 1 can also be written as x = x + 1

Russell Dias
  • 67,406
  • 5
  • 48
  • 71