Java Data Type Tutorial - Java String.valueOf(double d)








Syntax

String.valueOf(double d) has the following syntax.

public static String valueOf(double d)

Example

In the following code shows how to use String.valueOf(double d) method.

public class Main {
  public static void main(String args[]) {

    double doubleValue = 3.3; // no suffix, double is default
    System.out.printf("double = %s\n", String.valueOf(doubleValue));
  }
}

The code above generates the following result.