Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

re-loop after last item in array 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++;
	}
  }
}
 
PREVIOUS NEXT
Tagged: #item #array #java
ADD COMMENT
Topic
Name
6+4 =