Given an array of numbers (integers) how would I go about converting it to a string.
I am from JS so in we normally do :
[1 , 2 , 3 , 4 , 5].join(separator)
But Java doesn't seem to do that.
I tried :
array.join(" ")
But that throws an error on that it cannot find symbol.
Here is the code :
class Conv {
public static String findOut(int[] arr) {
return arr.join(" ");
}
}