这给了我一个错误:
提供数组初始化程序时无法定义维表达式。
如何解决?
static String names[] = new String[8]{
"Global Mining Technologies",
"Advanced Mine Group",
"Hi-Tech Mining Industrial",
"Victory Mining Co.",
"Miners of Land Inc.",
"Space-Age Mining Industries",
"EasyMine Co.",
"C.R.A.F.T Mining"};
答案 0 :(得分:2)
正如错误所提到的那样。 要么指定尺寸,要么不初始化内联,要么不指定尺寸,并且允许初始化元素。
请改用此习语:
static String names[] = {
"Global Mining Technologies",
"Advanced Mine Group",
"Hi-Tech Mining Industrial",
"Victory Mining Co.",
"Miners of Land Inc.",
"Space-Age Mining Industries",
"EasyMine Co.",
"C.R.A.F.T Mining"};