import org.apache.commons.lang.math.NumberUtils;
public class MainClass {
public static void main(String[] args) {
//Compare two double values
System.out.println("(FIRST > SECOND) >>> " +
NumberUtils.compare(2.11, 1.11));
System.out.println("(FIRST < SECOND) >>> " +
NumberUtils.compare(1.11, 2.11));
System.out.println("(FIRST == SECOND) >>> " +
NumberUtils.compare(1.11, 1.11));
}
}
|