understanding loops 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++) {}
int values[] = {1,2,3,4};
for(int i = 0; i < values.length; i++)
{
System.out.println(values[i]);
}
for (int i = 0; i < 3; i++) {}