for each java

Java
int [] intArray = { 10, 20, 30, 40, 50 };
        
for( int value : intArray ) {
   System.out.println( value );
}//itemset contains variables of type <Data Type>
for(<Data Type> item : itemset) {
  //loop
}for (int i : array) { 
    System.out.println(i);
}
for(int i : alist)
{
  i+=1
}for (int i=0; i<arr.length; i++) 
{ 
    type var = arr[i];
    statements using var;
}
// definition eine Datenstruktur, hier ein Array mit 9 Werten
int[] array = new int[]{4, 8, 4, 2, 2, 1, 1, 5, 9};

// ForEach Schleife
for( int k: array )
{
	System.out.println("k = "+k);
}

Source

Also in Java: