xdevel2000
xdevel2000

Reputation: 21364

Java 3D array initialization

I need to represent some spatial points: x,y,z

when I try to initialize the array like this:

int[][][] points
{
   {
      {100, 120, 10},
      {100, 120, 18},
      ...
   }
}

I got an error: Uncompilable source code - not a statement

where is the error?

Upvotes: 4

Views: 19389

Answers (2)

bakkal
bakkal

Reputation: 55448

You just forgot the = sign and a semicolon ;

int[][][] points = {{{100, 120, 10}, {100, 120, 18}}};

Upvotes: 13

Upul Bandara
Upul Bandara

Reputation: 5958

int[][][] points = {{{100,200,300},{120,200},{200,250}}};

Upvotes: 3

Related Questions