Java Data Type Tutorial - Java String.valueOf(long l)








Syntax

String.valueOf(long l) has the following syntax.

public static String valueOf(long l)

Example

In the following code shows how to use String.valueOf(long l) method.

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

    long longValue = 10000000000L; // L suffix indicates long
    System.out.printf("long = %s\n", String.valueOf(longValue));
  }
}

The code above generates the following result.