Can't field be assigned memory?
<p>I am new to Java. I have runtime error at the line containing <code>myImageViews[0].v1 = new ImageView(context)</code>. Is something wrong there?</p>

<pre><code>class MyImageViews
{
    ImageView v1;
    ImageView v2;
}

MyImageViews[] myImageViews;

protected class MyLayout extends RelativeLayout {
    public MyLayout(Context context) {
        super(context);
        myImageViews = new MyImageViews[10];
        myImageViews[0].v1 = new ImageView(context); //runtime error at this line   
    }   
}
</code></pre>
