Initializing a Java 3D Array

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

when I try to initialize the array as follows:

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

I have a mistake: Impossible source code - not a statement

where is the mistake?

+4
source share
2 answers

You just forgot the = sign and semicolon ;

 int[][][] points = {{{100, 120, 10}, {100, 120, 18}}}; 
+13
source
 int[][][] points = {{{100,200,300},{120,200},{200,250}}}; 
+3
source

Source: https://habr.com/ru/post/1312056/


All Articles