Is there a Java function to convert a positive int to a negative one and a negative int to a positive one?
I\'m looking for a reverse function to perfor
reverse
Yes, as was already noted by Jeffrey Bosboom (Sorry Jeffrey, I hadn't noticed your comment when I answered), there is such a function: Math.negateExact.
and
No, you probably shouldn't be using it. Not unless you need a method reference.