For cycle loop in Java example

Cycle for in Java example

public class MainClass {
	public static void main(String[] arg) {
		String[] arrayOfString = { "Hello", "people", "hello", "world!" };
 
		for (int i = 0; // start position , first cycle i == 0
                      i < arrayOfString.length; // if i < 4 (length of array) do loop
                       i++ // incrementation after cycle
                       ){
			System.out.println(arrayOfString[i]); 
                       // i++ incrementation
		}
	}
}
This entry was posted in Android Examples Code and tagged , , , , , , , . Bookmark the permalink.


Comments are closed.



4,326 views