Introduction
Java is an object-oriented, class-based, high-level programming language. It is based on the concept of WORA (write once use anywhere) for developer ease. Java classes are compiled into byte code. The compiled byte codes can be used on any platform supporting Java without recompiling the class.

We have eight primitive or native data types in Java, namely,
- int
- short
- long
- byte
- float
- double
- boolean
- char
We also have the option of multiple non-primitive data types in Java. The String is one of Java's most commonly used non-primitive data types. And there often arises the need to convert int to String in Java.
How to Convert int to String in Java?
In Java, you can convert an int to a String using methods like String.valueOf(int) or Integer.toString(int).
These methods convert the numeric value into its string representation without manual concatenation.
String.valueOf()
The String.valueOf function is the most commonly used function for the conversion of int to String in Java. The valueOf method belongs to the String class and is a static method. Let us look at the syntax for the same,
Syntax
String s=String.valueOf(i);Java int to String Example using String.valueOf()

In the above code, we have the integer to string in Java conversion using String.valueOf() function. 100 gets added to the integer value, whereas it gets concatenated with the string value, thus producing different results and depicting the conversion from int to string in Java.
Integer.toString()
The Integer.toString function is also a widely used function for converting int to String in Java. The toString method belongs to the String class and is a static method. Let us look at the syntax for the same,
Syntax
String s = Integer.toString(i);Java int to String Example using Integer.toString()

In the above code, we have the integer to string in Java conversion using Integer.toString() function. 100 gets added to the integer value, whereas it gets concatenated with the string value, thus producing different results and depicting the conversion from int to string in Java.
String.format()
The String.format method is used to format a given Data type to the String Data type using its String format. Let us look at an example for conversion of int to string in Java using String.format(),
Syntax
class int_to_string{Java int to String Example using String.Format()

In the above code, we have the integer to string in Java conversion using String.format() function. 100 gets added to the integer value, whereas it gets concatenated with the string value, thus producing different results and depicting the conversion from int to string in Java.
Try it by yourself on Java Online Compiler.
DecimalFormat class
The DecimalFormat class is used to format numbers into strings with a specific pattern. It’s useful for formatting numeric values in custom string formats.
Syntax:
DecimalFormat formatter = new DecimalFormat("pattern");
String string_number = formatter.format(number);
Java int to String Example using DecimalFormat
import java.text.DecimalFormat;
public class IntToStringExample {
public static void main(String[] args) {
int number = 50;
DecimalFormat formatter = new DecimalFormat("###");
String string_number = formatter.format(number);
System.out.println("This is the Integer value + 100: " + (number + 100));
System.out.println("This is the String value + 100: " + string_number + 100);
}
}
Concatenation Using Empty String
By adding an empty string ("") to an integer, Java automatically converts the integer to a string.
Syntax:
String string_number = number + "";
Java int to String Example using Concatenation
public class IntToStringConcat {
public static void main(String[] args) {
int number = 50;
String string_number = number + "";
System.out.println("This is the Integer value + 100: " + (number + 100));
System.out.println("This is the String value + 100: " + string_number + 100);
}
}



