// // another simple assertion example // // try: // // java AnotherAssertion 0 1 // java AnotherAssertion 1 0 // java AnotherAssertion 0 0 // // java AnotherAssertion -ea 0 0 // public class AnotherAssertion { public static void main(String[] args) { double x = Double.parseDouble(args[0]); double y = Double.parseDouble(args[1]); double ratio = x/y; if (ratio == 1.0) { System.out.println("identical " + x + " " + y); } else if (ratio > 1.0) { System.out.println("x > y " + x + " " + y); } else { assert (ratio < 1.0) : ratio + " " + x + " " + y; System.out.println("x < y " + x + " " + y); } } }