我的代码:
Object tempDifference;
Object testUser;
testUser = users.get(0);
it8 = difference_time.iterator();
it9 = users.iterator();
Object tempUser;
tempDifference = difference_time.get(0);
while (it9.hasNext()) {
tempUser = it9.next();
System.out.println(testUser+" "+tempUser);
if (testUser.equals(tempUser)) {
times.add(tempDifference);
testUser = tempUser;
} else {
times.add(value);
testUser = tempUser;
}
tempDifference = it8.next();
}
输入是:
1 2 2
输出是:
1 1
我要输出
1 2
为什么1 1
开始时输出不好?