,所以我有下面的代碼位:充分利用string.split數組()的Java
ArrayList table = new ArrayList();
然後,當我試圖讓:凡this.table使用啓動
while((line = reader.readLine()) != null) {
String[] row = line.split(",");
this.table.add(row);
長度在表中的行,像這樣:
for(int i=0; i<table.size(); ++i){
for(int j=0; j<table.get(i).length; ++j) {
//some code
}
它(強調得到(I)。長度;並且給了我一個錯誤,指出它無法找到象徵符號:長度。位置:類對象。
怎麼了?是否string.split()不返回數組?如果是這樣,爲什麼我不能使用任何數組類方法/變量?
謝謝!
謝謝。我需要導入任何使用List的東西嗎?因爲它告訴我它找不到符號? –
nvm。我明白了:)謝謝! –