For my project, I have to use a while loop or for loop. I'm not sure what I would use a loop for. Does anybody know what I can use a loop for?
int[] array = new int[] {5,4,3,2,1};
for(int i=0; i<array.length; i++) {
System.out.println(array[i]);
}
for(int element : array) {
System.out.println(element);
}
while(getOneIntersectingObject(Wall.class) == null) {
move(1);
}