Line Initialization of a Bidimensionnal array

Hi everyone,

I have this array :

double[][] points;

I know I can initialize it that way :

double[][] points = {{100,100},{120,100}}

I wonder if I can do something like that :

points[0] = {100, 100};

points[1] = {200,200};

and so on ...

Compiler insults me when I try to do this :)

Because when I do :

double[][] points = {{100,100},{120,100}}

I can get the value of points[0].

So i was thinking there might be away to set the value of points[0] ...

What is the correct syntax ?

Thanks in advance

Bracame.

[612 byte] By [Bracamea] at [2007-10-3 4:15:55]
# 1

double[][] points = new double[2][];

points[0] = new double[] { 100, 200 };

points[1] = new double[] { 400, 500 };

Kaj

kajbja at 2007-7-14 22:17:26 > top of Java-index,Java Essentials,Java Programming...
# 2
Thank you.Very much.For information, where did you read that ?Bracame.
Bracamea at 2007-7-14 22:17:26 > top of Java-index,Java Essentials,Java Programming...
# 3
> Thank you.> Very much.> > For information, where did you read that ?I think you can find that in most books which are used for teaching Java. A good book is The Java Programming Language, Fourth Edition.Kaj
kajbja at 2007-7-14 22:17:26 > top of Java-index,Java Essentials,Java Programming...