types of for loops in java code example
Example 1: Java for loop
int values[] = {1,2,3,4};
for(int i = 0; i < values.length; i++)
{
System.out.println(values[i]);
}
Example 2: how to make a loop in java
for (int i = 0; i < 3; i++) {}
Example 3: for loop java
for (int i = 0; i < 5; i++) {
System.out.println(i);
}