的各个元素,我很新的节目,我必须在这里失去了一些东西。第一部分起作用。第二部分发生错误。这是为什么?JAVA - 问题初始化数组的
// this works
private static int[] test2 = {1,2,3};
// this is ok
private static int[] test1 = new int[3];
// these three lines do not work
// tooltip states ... "cannot find symbol. class test1. ']' expected."
test1[0] = 1;
test1[1] = 2;
test1[2] = 3;
这应该工作,你可能想发布完整的代码 – 2010-08-13 04:04:29
你可以请你发布你的整个java文件?根据您当前的问题很难确定您粘贴的范围。 – Catchwa 2010-08-13 04:05:26