title: Cannot invoke method on the array type int[]
body: <p>I have a class listed as such:</p>
  
  <pre><code>public class Something {
  
  private int foo;
  private int bar;
  private int [] array = new int [16];
  
  public Something()
      {
      foo = 0;
      bar = 0;
      for (int i =0; i &lt; array.length; i++)
          {
          array[i] = 0;   
          }
      }
  </code></pre>
  
  <p>I want to break the array iteration into a separate method so I can reuse or re-invoke it throughout my program something like this:</p>
  
  <pre><code>public void arrayItteration(){
      for (int i =0; i &lt; array.length; i++)
      {
          array[i] = 0;   
      }
  }
  </code></pre>
  
  <p>Then I want to call it inside my public method such as:</p>
  
  <pre><code>public Something()
      {
      foo = 0;
      bar = 0;
      int [] arrayOp = array.arrayItteration();
      }
  </code></pre>
  
  <p>Ive tried the solution here: <a href="https://stackoverflow.com/questions/28398843/cannot-invoke-my-method-on-the-array-type-int">Cannot invoke my method on the array type int[]</a> by adding <code>this.</code> but its still not working. I have my setters and getters for all available variables.  Im sure theres an easy fix to this but please let me know if theres a way around it.</p>
  
  <p>Thank you</p>