Introduction
In this blog, you will learn how to convert integer to string in java. There are some common methods to convert int value to string in java.
Example
import java.util.*;
class IntegerToStringExample {
public static void main(String args[]) {
int i = 10;
// String.valueOf() Method
String str1 = String.valueOf(i);
System.out.println(str1);
System.out.println(String.valueOf(i) instanceof String);
int j = 20;
// Integer.toString() Method
String str2 = Integer.toString(j);
System.out.println(str2);
System.out.println(Integer.toString(j) instanceof String);
}
}
Output
Conclusion
In this blog, we have seen how to convert integer to string in java. Thanks for reading and I hope you like it. If you have any suggestions or queries about this blog, please share your thoughts. You can read my other blog and articles by clicking here.
Happy learning, friends!