Hi guys, I have written the following code which iterates over a integer array and returns a string by concatening the digits. Is there is an easier or more efficient way of writing this in Java similar to the C# function ToString?
private int[] myArray;
public int[] getMyArray
{
return myArray;
}
public String getArrayAsString()
{
String arrayAsString = "";
for(int index = 0; index < getMyArray().length; index++)
{
arrayAsString = arrayAsString + Integer.toString(
getMyArray()[index]);
}
return arrayAsString;
}