xxxxxxxxxx
# Convert integer to string
i = 23
s1 = int(i);
print ("string s1 =", s1);
# also
s2 = i.__str__();
print ("string s2 =", s2);
# and also
s3 = "{}".format(i);
print ("string s3 =", s3);
# another
print(f"as string {i} type {type(i)}" )
xxxxxxxxxx
String s = String.ValueOf(x); //converts a int x to a String s
//or
String s = Integer(x).toString(); //converts a int x to a String s
xxxxxxxxxx
int number = 36789;
--->
String s1 = number+"";
String s2 = String.valueOf(number);
String s3 = Integer.toString(number);
xxxxxxxxxx
// 1
String s = String.valueOf(i);
// 2
String s = Integer.toString(i);
// 3
String s = String.format("%d", i);
xxxxxxxxxx
StringBuilder sb = new StringBuilder();
sb.append("");
sb.append(i);
String strI = sb.toString();