Because the result of the division of two "int"s is an "int" (and not a "float" or "double"). This is explained in the Java Language Specification. If you would like to get the result of "4.5" then try this:
Hi , byte-->short-->int-->float-->double this sequence is "promotion". ("widening") byte<--short<--int<--float<--double this sequence is "casting". ("narrowing") If the result isn't the same as your expection, or having an error ("possible loss of precision") after compiling, you can check this first. Hope this helps.