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[]) {
/* ww  w .  j  av a 2 s.c  om*/
    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.





















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable