title: Array as an attribute in a java class?
body: <p>I have an assignment which consists of several small tasks:</p>
  
  <ol>
  <li>I have to initilize an array and fill it with a 200/400/800 values (each amount - once). </li>
  <li>I have to take the array values and put it in a red black tree, with certain conditions that are translated to methods.</li>
  <li>Some more tasks.</li>
  </ol>
  
  <p>I could do it all in the main class, however it seems to me I would be better off start a new <strong>class - handleArray</strong>.</p>
  
  <p>If I start a class such as:</p>
  
  <pre><code>public class handlyArray{
      protected int [] arr = new int[];
  }
  </code></pre>
  
  <p>But if I do that, should I write a "get" and "set" functions to get the array's length? </p>
  
  <p>The problem is that when I make this an error pops up - "Array initilizer expected".</p>
  
  <p>Additional functions I have in the class:</p>
  
  <pre><code>public void fillArray(handleArray arr, int k){
          Random rand=new Random();
          for (int i = 0; i &lt;k ; i++) {
              int value = rand.nextInt(1024);
              arr[i]=value;
          }
      }
  </code></pre>
  
  <p>- <strong>A function that creates Nodes for the redblackTree and inserts them to the tree</strong></p>
  
  <p>Any suggestions for how to build it?
  <strong>Can I build the class with no attributes at all?</strong></p>
  
  <p>Thanks!</p>