Dividing two integers always results in an integer. If you want to get a decimal result from dividing two integers, use floating point division. If you try to divide an integer by 0 using integer division, you’ll get an ArithmeticException error at runtime, even if the program compiles fine. [2] X Research source
When dividing by zero with floating point division, the result will be NaN (Not a Number). [4] X Research source