I figured out the problem, I was suppose to use Size() instead of values.length.
but now I have another problem..
Code:
StringBuilder a = new StringBuilder("[ ");
for(int i = 0; i <values.length; i++){
if(i<values.length-1) {
a.append(values[i] + ", ");
} else {
a.append(values[i]);
}
}
a.append(" ]");
return a.toString();
}
It is suppose to print out array like [3, 4, 5, ,6 ] etcetc..
I'm very new to using StringBuilder.. so I tried to copy from one of the notes I took in class. But again, it said 'fail' in the tester program.
Did I make a mistake somewhere..?