title: Initialize object array with constructor parameter
body: <p>Lets say I have 2 classes:</p>
  
  <pre><code>public class Carinfo {
  
  private String Car;
  private Carinfo [] value; 
  
  Carinfo (String someCar, int carValue) {
  
  this.car = someCar;
  //At this point I want the "int carValue" to initialize private Carinfo [] value
  }
  </code></pre>
  
  <p>The second class creates car objects, for this example I'll do it with an array</p>
  
  <pre><code>public class Generatecar {
  
  Carinfo[] mycars = new Carinfo[1];
  
  public Generatecar {
  
  mycars[0] = new Carinfo("Lada", 9000);
  
  }
  </code></pre>
  
  <p>What I want is to insert the carValue into the private Carinfo [] value; array. How do I initialize the array within the Carinfo constructor?</p>
  
  <p>If I said something that is unclear, please let me know.</p>