Search
 
SCRIPT & CODE EXAMPLE
 

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();
        }

    }

}
Comment

java nested for loop

for (int i = 0; i < 10; i++) {
	for (int j = 0; j < 10; j++) {
		System.out.println("*");
    }
  System.out.println("");
}
Comment

nested for loop java


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

        for (int x = 0; x < 5; x++) {
            for (int y = 0; y < 5; y++) {
                System.out.println(y);
            }
            System.out.println();
        }
    }
}
Comment

nested for loop java


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

        String names[][] = {
                { "Jasmine", "jasmine123" },
                { "lyka", "lyka123" },
                { "marbie", "marbie123" }
        };
        for (int row = 0; row < names.length; row++) {
            for (int col = 0; col < names[row].length; col++) {
                System.out.println(row + ":" + col);
            }
            System.out.println();
        }

    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: android studio breakpoint not working 
Java :: in java how to throw exception from function 
Java :: start new activity android 
Java :: java random number between 2 values inclusive 
Java :: get input in java using joptionpane 
Java :: unprocessed continuation reference(s) remaining name 
Java :: Java for Keyword 
Java :: android list index 
Java :: java scanner string nextline after nextint 
Java :: java % 
Java :: Java Stack class peek() method 
Java :: printing arraylist 
Java :: java create map 
Java :: java insert char in string at index 
Java :: java dynamic method dispatch 
Java :: running sum of 1d array leetcode 
Java :: java collapse string array 
Java :: java print array backwards 
Java :: double.parsedouble in java 
Java :: iterate through hashMap by forEach loop 
Java :: date minus date java 
Java :: java array loop 
Java :: java switch case 
Java :: how to get the max value of an array java 
Java :: arraylist to array java 
Java :: intellisense for eclipse java 
Java :: java mockito any string import 
Java :: classcastexception in java 
Java :: generating random number 
Java :: write files with FileOutPutStream java 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =