3

Project[[ | ]] array = new Project[[1 | 1]];

I am not getting which kind of array declaration is this? Also I don't know if it is correct or not. I tried it in Netbeans but it is not allowed. But in this example http://wiki.netbeans.org/OpenProjectsProgramaticallyInNetBeansIDE I found such example.

Give me some idea if it is correct.

4

2 回答 2

2

根据javacJDK7,它是无效的语法(error: illegal start of expression指向第一个[[)。我认为它一定是生成该页面或类似的错误。

于 2013-07-31T09:40:38.783 回答
1

这是无效的语法。有关声明数组的正确语法,请参阅 Java 语言规范。 规格

该规范特别指出:

数组初始值设定项以逗号分隔的表达式列表形式编写,用大括号 { 和 } 括起来。

没有提到添加管道或嵌套支架。

于 2013-07-31T09:44:09.797 回答