Is there any way to use for loop to print values in certain range but with a specific order- java : <p>I'm sorry if my question is not very clear because i can't find any other way on how to explain it better.
I want to do something like this by using for loop:</p>

<blockquote>
  <p>First iteration : 0 , 1, 2, 3, 4,</p>
  
  <p>Second iteration: 1, 2, 3, 4, 0</p>
  
  <p>Third Iteration : 2, 3, 4, 0, 1</p>
  
  <p>Fourth Itertaion : 3, 4, 0, 1, 2</p>
  
  <p>Fifth iteration : 4, 0, 1, 2, 3</p>
  
  <p>Final Iteration : 0, 1, 2, 3, 4 </p>
</blockquote>

<p>It will print value from 0 to 4 on the first iteration.<br>
And then for the second iteration and the followings the pattern will continue as shown above.
Is it possible to do this using for loop in java?</p>
