java can use foreach for s code example Example: foreach java for (String name : names) { System.out.println(name); }