title: How to change for loop with certain values
body: <p>I am new to java. I need help with a basic problem. How do I change the for loop limits when a certain condition is met?</p>
  
  <p>For example: </p>
  
  <pre><code>x = 0;
  y = 100,
  z = 20;
  
  for (w=x ; w&lt;=y; w+=z)
  {
      System.out.println("this is wat i needed");
  
      if (w==60)  
          // from here onwards i want to change z value to 4
  } 
  </code></pre>