title: How to initialize array in java when the class constructor has parameters?
body: <p>I have this class constructor:</p>
  
  <pre><code>public Category(int max){
  ...
  }
  </code></pre>
  
  <p>The thing is, I want to make an array of this class, how do I initialize it?</p>
  
  <pre><code>private Category categories = new Category(max)[4];
  </code></pre>
  
  <p>Does not work.</p>
  
  <p><strong><em>UPDATE</em></strong></p>
  
  <p>Do I need to do something like this?</p>
  
  <pre><code>private Category[] categories = new Category[4];
  </code></pre>
  
  <p>And then initialize each object?</p>