Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

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 :: switch case java with char 
Java :: playerhead command minecraft 
Java :: java for each loop 
Java :: terminate a frame java 
Java :: java count to 10 
Java :: unique elements in array java 
Java :: converter float para string em java 
Java :: export java_home linux 
Java :: java call method from another class example 
Java :: java error message 
Java :: findviewbyid in kotlin Just using id name . 
Java :: set source image in android studio 
Java :: repository query spring boot 
Java :: spigot dispatchcommand 
Java :: synchronized java 
Java :: change color of drawable android studio 
Java :: send action bar message bukkit 
Java :: Concept of Association in java 
Java :: how to create localdate object in java 
Java :: java for loop increment by 3 
Java :: declare variables java 
Java :: java regex case insensitive 
Java :: java letter alphabet index 
Java :: java append a string to file 
Java :: hexstring to string In java 
Java :: define an array of size n in java 
Java :: java list to array 
Java :: java iterate map and remove 
Java :: hashtable java 
Java :: java get filename without extension 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =