i got this code : and i want to Display each element in the vector seperated by a space.
public void display() {
for(int i = 0; i < length; i++) {
System.out.print(" "+this.elements[i]);
}
System.out.println();
}
i am getting all the elements with a space between each element, BUT HOW CAN I GET RID OF THE WHITE SPACE AT THE BEGINNING OF THE LINE ??
and im not sure if theres something to do with the VECTOR CLASS, thats the beginning of my code:
public class Vector {
private Long sum;
private Long mode;
private Long median;
private Long minimum;
private Long maximum;
private final int length;
private final long[] elements;
public Vector(int length) {
this.sum = null;
this.mode = null;
this.median = null;
this.minimum = null;
this.maximum = null;
this.length = length;
this.elements = new long[length];
}
the code is a bit long, so i hope i can get some help from what i have posted thank you :)