title: How to print out only a certain amount of elements in a arraylist in java
body: <p>I have tried several different ways and none have actually worked.</p>
  <p>I tried this while loop here:</p>
  <pre><code>int i = 0;
          while (i  &lt; 14){
            if (i &lt; 14){
              break;
            }
            else {
              for (String str : arraylist)
                {           
               i++;   
                 System.out.print(arraylist.get(i));  
              }
  </code></pre>
  <p>and i've also tried this:</p>
  <pre><code>for(int i = 0; i &lt; 14; i++) {
      System.out.print(arraylist.get(i))
  
  }
  </code></pre>
  <p>Is there a certain way to print out only a select amount of indexes in a array list? I've been struggling with this for a while. thanks guys.</p>