title: Iterating two lists same time which have different size
body: <p>I have two list X,Y.</p>
  
  <p>Which are lists of Strings .</p>
  
  <p>there is a possibility to have the two lists different sizes .</p>
  
  <p>If both lists are of same size of 2 then i can procedd like </p>
  
  <pre><code>   for (int i =0;  i&lt;anyList.size(); i++){
       system.out.printLn(X(i) +" "+Y(i));
    }
  
  example result  :
  
  stringX1 stringY1 
  stringX2 stringY2
  </code></pre>
  
  <p>how can i handle the loop which have different sizes </p>
  
  <p>example result should be look like this </p>
  
  <p>example result  :</p>
  
  <pre><code>    stringX1 stringY1 
      stringX2 stringY2
      stringX3
      stringX4
  </code></pre>