//Java code to convert afloat to String
public class Main {
public static void main(String args[]) {
float a = 10.23f;
float b = 23.456f;
//variable to store result
String result = null;
//converting float to string
result = Float.toString(a);
System.out.println("result (value of a as string) = " + result);
result = Float.toString(b);
System.out.println("result (value of b as string) = " + result);
}
}
Output
result (value of a as string) = 10.23
result (value of b as string) = 23.456
Java code to convert a Float to String
Output