Java String.valueOf(int i)

Syntax

String.valueOf(int i) has the following syntax.

public static String valueOf(int i)

Example

In the following code shows how to use String.valueOf(int i) method.


public class Main {
  public static void main(String args[]) {
    /* ww w . j ava2  s  . com*/
    int integerValue = 7;
    System.out.printf("int = %s\n", String.valueOf(integerValue));
  }
}

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