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 loop

// This nested for loop will print 5 rows of 20 asterisks each

for(int i = 0; i < 5; i++) {
  for(int j = 0; j < 20; j++) {
    System.out.print("*");
  }
  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 :: what is inheritance in java 
Java :: java search tree 
Java :: Caused by: java.lang.ClassNotFoundException: 
Java :: can abstract class have constructor in java 
Java :: java 8 seconds to days 
Java :: what are abstract classes in java 
Java :: findview by id in android 
Java :: how to replace a character with another character in a string in java 
Java :: string split java 
Java :: ascii values to display certain characters in java 
Java :: top easiest languages programming to learn 
Java :: arraylist add at index 
Java :: java stream group by multiple fields 
Java :: java calling a method 
Java :: springboot avoid generated security password: 
Java :: get my jre path 
Java :: Java Enum ordinal() 
Java :: reverse an android application 
Java :: como pegar o valor de um campo de texto swing 
Sql :: postgres get size of database 
Sql :: sql server reset id 
Sql :: oracle create directory 
Sql :: fetch first 5 rows in oracle sql developer 
Sql :: mysql stop password policy 
Sql :: get all tables postgres 
Sql :: mysql command line xampp ubuntu 
Sql :: sql server kill all connections 
Sql :: see mysql users ubuntu 
Sql :: ms sql rename database 
Sql :: mysql last day of next month 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =