int num = -5; int sign = Integer.signum(num); System.out.println(sign); // Output: -1
double num = 3.14; double sign = Math.signum(num); System.out.println(sign); // Output: 1.0Both of these examples use the signum() method to determine the sign of a number or double value. The first example uses the Integer class to call the signum method while the second example uses the Math class. Therefore, the signum method is part of the java.lang package library.