Very simple. It is the same as you print out on the console. Whatever format you want is fine. In stead of printing out to the screen, you just make it to String. Oh and do not forget to use @Override to let JAVA knows that the method is overriding the default method from Object class (which return junk for you).
@Override
public String toString() {
String output="";
// iterate through your ArrayList here
for(int element : numbers) {
// in your display, you would use...
// System.out.print(element+" ");
// in converting to string, you could use...
// out += element+" ";
// So it is your decision to make whatever string to be like.
}
return output;
}