String[] elements = {"a", "a", "a", "a"}; for (String s: elements) { //Do your stuff here System.out.println(s); }