For Loop Versus Foreach Java Code Example
Example 1: foreach java
for (String name : names) { System.out.println(name);}
Example 2: java for each loop
// definition eine Datenstruktur, hier ein Array mit 9 Wertenint[] array = new int[]{4, 8, 4, 2, 2, 1, 1, 5, 9};// ForEach Schleifefor( int k: array ){ System.out.println("k = "+k);}
Belum ada Komentar untuk "For Loop Versus Foreach Java Code Example"
Posting Komentar