Java department
If you want a decimal result, you should declare that the variable is floating-point when you declare it.

Floating = 0.0f

double = 0.0

supplement

Because the 5 and 2 you declare are both variables of type int, the calculated result is also an integer variable with no decimal part, so you should declare them as floating point numbers (that is, decimals). For example, F after float = 5.0ffloat = 2.0f means that 2.0 is a float single-precision floating point number, and if it is not F, it is the default double-precision floating point number. Divide two numbers of floating-point number type, then the calculation result is also floating-point number type, so there will be a decimal part.