The expression '-0' as an int literal is unary minus applied to 0, which is just the int value 0 — Java's int type has no signed zero. When 10.0 (a double) is divided by that int 0, the 0 is promoted to double 0.0 (not negative zero), so the division 10.0/0.0 evaluates to Double.POSITIVE_INFINITY under IEEE 754 floating-point rules (division of a positive number by zero yields positive infinity), and no exception is thrown for floating-point division by zero. The if-condition d == Double.POSITIVE_INFINITY is therefore true, so the code compiles, runs, and prints 'Positive infinity'. It would only print negative infinity if the numerator were negative or if -0 were an actual signed double zero.