2015-04-12 67 views

回答

0
int line = 0; 
while((sCurrentLine = br.readLine()) != null){ 
    String[] tmp = sCurrentLine.split(",");//split the line up into its separate values 

    for(int i = 0 ; i < 3 ; i++) 
      myArr[line][i] = Integer.parseInt(tmp[i]); 
      //convert the values into integers and insert them at the matching position 
      //in the array 


    line++; 
} 
+0

這將是很好,如果你可以包括你的答案的一些解釋,爲人們誰可能沒有完全理解你的實施效益。 – unclemeat

+0

java.lang.NullPointerException我在myArr [line] [i] = Integer.parseInt(tmp [i])上得到這個錯誤; –

+0

你能評論stacktrace pls的完整第一行嗎? – Paul