This is my first question here. So The thing is...I would like to understand, how could I reverse an array, that contains objects, without using Array.java.utils and a Temporary array.
public void reverse() {
Ball [] ballsTemp = new Ball[balls.length];
for (int i = 0; i < balls.length / 2; i++) {
ballstemp[i] = balls[i];
balls[i] = balls[balls.length -1 - i];
balls[balls.length -1 - i] = ballstemp[i];
}
}
So this is not what I want ^
notas? Why is your temporary variable an array?