1.

We make a method, instead of, addCoordinateAtTheBack: addCoordinateInTheFront: box 0,1,2 are just examples of boxes.

java programming row

void addCoordinateInFront(Coordinate coordinate) {
	//place every element in the row, one place to the right
	//new element will be on place 0 ==> coordinateArray[0]
	//adding a new element so numberOfElemnts + 1
}

This will be the result:

void addCoordinateInFront(Coordinate coordinate) {
	for(int i = numberOfElements; i >= 1; i--) {
		coordinateArray[i] = coordinateArray[i-1];
	}
	coordinateArray[0] = coordinate;
	numberOfElements++;
}