the method should return all filled items from the array but instead, it returns the last item from the array.
public String toString() {
String result = "";
for( int i = 0; i < list.length; i++ )
{
result = String.format("%d. %s\n", i+1, list[i]);
}
return result;
}