One way would be to just add a negative sign in front of the value:
int myInt = -myInt;
Another way to switch between a positive or negative number in a statement would be to multiply it by -1.
myInt = myInt * -1;
0
solved Positive and negative number values [duplicate]