title: Using modulus operator in for Loop with if statements - Java beginner
body: <p>I hope someone can help. My problem is with using the modulus operator in a for loop. My code is as follows:</p>
  
  <pre><code>for (int i = 0; i &lt; 10; i++)
  
  if (i % 2 == 0) {
  method1();
  }
  else {
  method2();
  }
  </code></pre>
  
  <p>I understand how this loop works in that it iterates between if and else because of the even and odd numbers created by the condition that uses
  the modulus operator (i % 2 == 0)</p>
  
  <p>However, I want to create a condition using the modulus operator so that my loop iterates through 4 methods - as in:</p>
  
  <pre><code>loop starts{
  
  method1();
  method2();
  method3();
  method4();
  
  loop repeats
  }
  </code></pre>
  
  <p>I can't work out how to accomplish this. I would appreciate any help and advice. </p>
  
  <p>Thanks in advance.</p>