In this example, we learn how to convert a Integer object into String object.
Source Code
package com.beginner.examples;
public class GetStringInInteger {
public static void main(String[] args) {
Integer integer = new Integer(22);
// Use the toString() method in the Integer object to get the string
String strInt = integer.toString();
System.out.println(strInt);
}
}
Output:
22