What will the following for loop do?

for (int i = 0; i < 10; i = i + 2)
{
    System.out.println(i);
}
Print out even numbers less than 10
  • Print out all numbers less than 10
  • This loop will cause an error
  • This loop will loop infinitely

Remember the condition will be checked once before the loop starts and then once after every iteration!