Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

nested for each loop java


public class Sample {
    public static void main(String[] args) {

        String names[][] = {
                { "Jasmine", "jasmine123" },
                { "lyka", "lyka123" },
                { "marbie", "marbie123" }
        };
        for (String name[] : names) {
            for (String info : name) {
                System.out.println(info);
            }
            System.out.println();
        }

    }

}
 
PREVIOUS NEXT
Tagged: #nested #loop #java
ADD COMMENT
Topic
Name
4+5 =