using the toString method to print an array
Hi folks, I need some help on an assignment I am working on for class. Its due today. I am comfortable with most of what I have, I just can't get the method to return my array objects to string correctly. I am not sure what I am doing wrong.
I have an array:
C  r = new C[NUM_C];
and it works from the tests I have done on it. But, in this same class I need to create a method to print out the objects in the array by calling the toString method. I got it to work with the Arrays.toString but it formats the ouput funny. Like since the NUM_C is a constant, it attaches null values to the other elements in the array. The array is not suppose to be filled to capacity. Can anyone maybe lend a hand?