In the first case you are dealing with two integers which results in the exception. In the second case you have a double so the integer gets promoted to a double (JLS 5.6.2). Not positive but I think the resulting infinity is to prevent program termination.