Check out example codes for "java for in loop". It will help you in understanding the concepts better.

Code Example 1

for (type variableName : arrayName) {
  // code block to be executed
}

Code Example 2

for (int i = 0; i < 5; i++) {
  System.out.println(i);
}

Code Example 3

for(int i = 0; i < 10; i++)
{
  //do something
  
  //NOTE: the integer name does not need to be i, and the loop
  //doesn't need to start at 0. In addition, the 10 can be replaced
  //with any value. In this case, the loop will run 10 times.
  //Finally, the incrementation of i can be any value, in this case,
  //i increments by one. To increment by 2, for example, you would
  //use "i += 2", or "i = i+2"
}

Code Example 4

int values[] = {1,2,3,4};
for(int i = 0; i < values.length; i++)
{
 	System.out.println(values[i]); 
}

Learn ReactJs, React Native from akashmittal.com