How to assign negative value in Java code example Example: Make a negative number positive Java Math.abs(-5); // returns 5