MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnjava/comments/4j6j9d/convert_an_int_to_a_string_in_java/
r/learnjava • u/awsometak • May 13 '16
1 comment sorted by
4
Use the Integer class. No imports necessary.
int x = 12; String s = Integer.toString(x); System.out.println(x+10); System.out.println(s+10); Output: 22 1210
Likewise, you can use the String class:
int x = 12; String s = String.valueOf(x);
4
u/OA998 May 13 '16 edited May 13 '16
Use the Integer class. No imports necessary.
Likewise, you can use the String class: