-1 if num is negative
0 if it is zero, and
1 if it is positive
public class MainClass {
public static void main(String args[]) {
System.out.println(Integer.signum(10));
System.out.println(Integer.signum(-10));
System.out.println(Integer.signum(0));
}
}
1
-1
0