Better way to assign value to array of object in Java
<p>I have a class in Java which has 2 fields like</p>

<pre><code>Class A
{
  int i;
  double v;
}
</code></pre>

<p>I make an array of object of class A like:</p>

<pre><code>A[] x = new A[3];
</code></pre>

<p>After assigning the memory to object I assign value to object like:</p>

<pre><code>A[0].i = 1;
A[0].v = 2.5;
A[1].i = 2;
A[1].v = 3.5;
A[2].i = 55;
A[2].v = 1.5;
</code></pre>

<p>I was wondering it there was a better way to initialize the object-values.</p>
