What is the output of this program?
class Literal7
{
public static void main(String[] args)
{
float f=1.2;
System.out.println(f);
}
}
/*
Output:- CE[possible loss of precision]
Explanation:- By default every floating literal is of double type but we can specify
explicitly as float type by suffixed with 'f' or 'F'. "float f=1.2f"
*/
{
public static void main(String[] args)
{
float f=1.2;
System.out.println(f);
}
}
/*
Output:- CE[possible loss of precision]
Explanation:- By default every floating literal is of double type but we can specify
explicitly as float type by suffixed with 'f' or 'F'. "float f=1.2f"
*/
0 comments: