//Java code to convert a double to String
public class Main {
public static void main(String args[]) {
double a = 10;
double b = 20;
//variable to store result
String result = null;
//converting double to string
result = Double.toString(a);
System.out.println("result (value of a as string) = " + result);
result = Double.toString(b);
System.out.println("result (value of b as string) = " + result);
}
}
Output
result (value of a as string) = 10.0
result (value of b as string) = 20.0
Java code to convert a Double to String
Output