简体   繁体   English

Java 3D数组初始化

[英]Java 3D array initialization

I need to represent some spatial points: x,y,z 我需要表示一些空间点: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? 错误在哪里?

你刚忘了=符号和一个分号;

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM