why is System.out.println(9f/4) // equals 2.25 | Sololearn: Learn to code for FREE!

+17

why is System.out.println(9f/4) // equals 2.25

why is the f neglected please help

10/19/2017 8:26:05 AM

kenneth mayor

3 Answers

New Answer

+3

Here is explained what the 'f' means: https://stackoverflow.com/questions/9748160/why-f-is-placed-after-float-values

+16

+2

if we perform any operation between two different data type then automatically result will be promoted to highest rang datatype.so output will be 2.25