What is the output of this program?

class DataType6
{
public static void main(String[] args)
{
float f=5.5;
System.out.println(f);
}
}
/*
Output:- CE[possible loss of precision]
Explanation:- "double" data type value cannot be assigned to "float" data type. 5.5 is "double" data
type value. If we prefixed "f" to "5.5" then it will become "float" value. Then we
can assigned to "float" data type and no error will be rised.
*/

1 comment: