Ponowna pętla po ostatnim elemencie w tablicy Java
public class Main {
public static void main(String[] args) {
String[] items = new String[] {"one", "two", "three", "four"};
int i = 0;
while(true){
System.out.println(items[i % items.length]);
i++;
}
}
}
Anxious Alligator