Search
 
SCRIPT & CODE EXAMPLE
 

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++;
	}
  }
}
Comment

PREVIOUS NEXT
Code Example
Java :: mapToJsonString 
Java :: java stream anymatch vs findany 
Java :: Java Enable assertion in package names 
Java :: download sources and javadoc 
Java :: Java Protected Access Modifier package two 
Java :: spring import properties file xml 
Java :: dialog background dimming in android 
Java :: Switch statement expressions jdk12+ 
Java :: priority queue java remove 
Java :: isblank vs isempty java string utils 
Java :: java file and stream 
Java :: aabb collision java 
Java :: capitalize a letter in java 
Java :: Retries Java 
Java :: return vs break 
Java :: java see you next happy year 
Java :: diiferent ways to run spring boot 
Java :: check if there is connexion android studio 
Java :: how to stop spring boot application 
Java :: has places api got deprecated??? 
Java :: how do you create a txt file in java 
Java :: java get if contains else 0 
Java :: java private keyword 
Java :: api to accept a csv file spring boot 
Java :: how to use advanced math in java 
Java :: Java Constructor invocations 
Java :: for loop in firebase snapshot in java 
Java :: sort stream by key java 
Java :: autorest generate java client 
Java :: How to set the java.library.path from Eclipse 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =