title: Skip int element in array if it is equal to 6 when printing
body: <p>I want to skip element when printing, if value of this element is equal to 6. Can you tell me where I'm wrong?</p>
  
  <pre><code>public class Task3_Killing_6 {
  
      public static void main(String[] args) {
  
          int[] array = {2,4,5,6,8,6,3,4,6};
          int[] killSix = new int [9];
  
          for (int i = 0; i &lt; array.length - 1; i++) {
              if(array[i] == 6){
                  continue;
              } else {
                  killSix[i] = array[i]; 
              }
  
          }
  
          System.out.println(java.util.Arrays.toString(killSix));
      }
  
  }
  </code></pre>
  
  <p>And result is </p>
  
  <pre><code>[2, 4, 5, 0, 8, 0, 3, 4, 0]
  </code></pre>
  
  <p>I want to be </p>
  
  <pre><code>[2, 4, 5, 8, 3, 4]
  </code></pre>