Assert/check Greater Equal Than - Java java.lang

Java examples for java.lang:Assert

Description

Assert/check Greater Equal Than

Demo Code



public class Main{
    public static void main(String[] argv) throws Exception{
        double number = 2.45678;
        double checkValue = 2.45678;
        String name = "java2s.com";
        checkGreaterEqualThan(number,checkValue,name);
    }//from   w  ww. j a  va  2s.  c o m
    public static void checkGreaterEqualThan(double number,
            double checkValue, String name) throws AssertionException {
        if (number < checkValue) {
            throw new AssertionException(name + " must be at least "
                    + checkValue);
        }
    }
}

Related Tutorials