【发布时间】:2016-06-20 14:03:55
【问题描述】:
我有三个 Double Arraylist。我想将数组 1 到数组 2 并将其放在第三个数组中。
// ArrayList 1
[0.0, 1.0, 0.0, 1.0]
// ArrayList 2
// Random number generated by random()
[0.37668669271524147, 0.429455596516655, 0.7337191115424969, 0.29389239043901294, 0.7050413406305202]
还有我的代码
for (int i = 0; i < plans.size(); i++) {
for (int j = 0; i < value.size(); j++) {
try {
plansval.add(plans.get(i) * value.get(j));
}
catch (IndexOutOfBoundsException e) {
System.out.println("IndexOutOfBoundsException: " + e.getMessage());
}
}
}
我收到IndexOutofBoundsExceptions。
你能帮我解决这个问题吗谢谢。
【问题讨论】:
标签: java arraylist indexoutofboundsexception