Java Data Type Tutorial - 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[]) {
    
    int integerValue = 7;
    System.out.printf("int = %s\n", String.valueOf(integerValue));
  }
}

The code above generates the following result.