When you create a for loop, the second element of the declaration tells the loop under what conditions to execute. It does not tell the loop where to stop. For example if you say the following:
for (int j = 0; j < 10; j++)
You have told the loop to execute as long as j is less than 10. This is exactly correct. A common beginner mistake is to write this as:
For (int j = 0; j = 10;j++)
This will never work. You have instructed the loop to execute as long as j is equal to 10, yet you initialized j to 0. That means the loop will never execute!