foeach array java code example
Example 1: for each java
int [] intArray = { 10, 20, 30, 40, 50 };
for( int value : intArray ) {
System.out.println( value );
}
Example 2: for each loop java string array
//iteration by using the enhanced for loop provided by Java 5 or later
for (String str : strArray3) {
System.out.print(str);
}