雙數組[0]我有這樣的代碼:轉移的ArrayList在Java
public class Test{
arrayList<String> list = new ArrayList<String>();
String[][] temp_list;
public static void main(String[] args)
{
String temp = list.get(0);
temp_list[0] = temp.split(" ");
}
}
我想的第一個項目在「清單」轉移到temp_list [0] .compiling是成功的,但我得到的錯誤時,我運行它。這是錯誤:
Exception in thread "main" java.lang.NullPointerException
at Test.main(Test.java:this line=>temp_list[0] = temp.split(" ");)
任何人都可以幫助我嗎?
太棒了!!!它的工作now.yes,我沒有分配的temp_list.thanks哥們的大小! – Roubie
沒問題,不客氣。 – aioobe