1
在項目中,我使用了動態數組,但輸出結果中的錯誤: 我的代碼:問題與動態數組列表
for (int i = 0; i < save; i++) {
a[i] = (double) db.get_a("loc", i);
b[i] = (double) db.get_b("loc", i);
for (int j = 0; j < 6; j++) {
numbers.add(a[i] + b[i]);
}
Log.i("LOG", "Array Index #" + i + " = " + numbers.get(i));
}
Log.i("LOG", "Array size #" + numbers.size());
在我的logcat
:
11-23 15:35:07.443: I/LOG(1880): Array Index #0 = 7.0
11-23 15:35:07.473: I/LOG(1880): Array Index #1 = 7.0
11-23 15:35:07.535: I/LOG(1880): Array Index #2 = 7.0
11-23 15:35:07.583: I/LOG(1880): Array Index #3 = 7.0
11-23 15:35:07.693: I/LOG(1880): Array Index #4 = 7.0
11-23 15:35:07.763: I/LOG(1880): Array Index #5 = 7.0
11-23 15:35:07.774: I/LOG(1880): Array size #36
db.get_a和db.get_b如何實現? – SMA 2014-12-13 16:49:45
它不是cleat,最新的問題。你能詳細說明一下,以便用戶可以在這裏幫忙 – Shiv 2014-12-13 17:10:42