How to convert int into string format in java? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to convert int into string format in java?

15th Jun 2018, 5:47 PM
Maninder $ingh
Maninder $ingh - avatar
4 Answers
+ 3
You can simply do that : String.valueOf(Primitive data type); or you can convert primitive data types to string with + operator like: 3 + "2" = "32" "world " + 2 = "world 2" Note : if you have variable which created with a wrapper class or better i say any object you should use this code: (This example is for an object (i) which created in Integer wrapper class) Integer i = 6; String.tostring(i); output : "6" hope useful!
17th Jun 2018, 9:39 AM
Ali
Ali - avatar
+ 3
Ali perfectly explained. I was also looking for this answer.
27th Jun 2018, 8:09 PM
Dhruv garg
Dhruv garg - avatar
+ 1
Dhruv garg your welcome!
29th Jun 2018, 11:03 AM
Ali
Ali - avatar