looping 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: java loop
for (int i = 0; i < 10; i++) {
System.out.println(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 < 10; i++) {
System.out.println(i);
}