I'm new to Java language and I'm preparing for the Oracle basic certification exam recently. Here's one question which make me confused while I'm looking into some sample questions.
When initiate a field in float type, you must give a value like '1.0f'. But when it goes to calculation, the 'f' is not necessary any more. Even in the result of calculation to float type fields, 'f' is missing. Just curious about what happened to it and any influence. Really appreciate if anyone could take some time to answer this, thanks in advance.
float x = 22.00f % 3.00f;
System.out.println(x);
Output after run is 1.0 instead of 1.0f
I'm using JDK1.8.