Loop through the array one by one
public class loops { public static void main(String[] args) { for (int i = 0; i < 3; i++) {} /*from w w w . jav a2s. c o m*/ } int[] arr = {1, 9, 9, 5}; for (int i = 0; i < arr.length; i++) { int el = arr[i]; System.out.println(el); } }