日期:2014-05-20 浏览次数:20767 次
/* *不报错的写法 */ public static void getSummeVonXijMalDifferenzMalwg() throws FileNotFoundException, IOException{ getProdukt(); double[] sum = new double[windowSize]; int j = 0; while(j < windowSize){ for(int i = 0; i < myArray.length; i++){ sum[j] = sum[j] + myArray[i][j]; // sum of myArray's rows //这里就不报错。 } j++; } }
/* *这个报错程序要如何修改才能成功运行?为了提高速度,我需要这种static全局的写法 */ public static double[] sum = new double[windowSize]; ..... public static void getSummeVonXijMalDifferenzMalwg() throws FileNotFoundException, IOException{ getProdukt(); int j = 0; while(j < windowSize){ for(int i = 0; i < myArray.length; i++){ sum[j] = sum[j] + myArray[i][j]; // sum of myArray's rows //上面这行报错 } j++; } }