Mega Code Archive

 
Categories / Java / Collections Data Structure
 

Use the new shorthand notation to iterate through an array

public class Main {   public static void main(String args[]) {     String s[] = { "a", "b", "c", "d" };     for (String element : s)       System.out.println(element);   } }