The following code results in compile time error. Identify the error.
public static void display ()
{
int n =123456;
float f =100.12;
System.out.println(“Float value ” +f);
}
/*
To indicate that a given value should be treated as a float,
we need to use the f suffix:
float fl = 30.6f;
^
*/
public static void display (){
int n =123456;
float f =100.12f;
System.out.println("Float value " + f);
}
Comments
Leave a comment