for loop will not loop
Posted
by
Bjørn Jostein Aurheim
on Stack Overflow
See other posts from Stack Overflow
or by Bjørn Jostein Aurheim
Published on 2012-05-09T12:37:10Z
Indexed on
2012/09/26
3:37 UTC
Read the original article
Hit count: 239
I have a for loop that I will use to compute time intervals to add to an ArrayList. The problem is that I can not prove that the for loop is being executed. Nothing is printed when using the system.out.println() statement, and nothing is added to the array from inside the loop ... any sugestions?
// lager tidspunkter og legger disse inn i en Array kalt tider
tid.setTimer(16);
tid.setMinutter(0);
tid.setSekunder(0);
tider.add(tid.asString());// String "16:00" is added as it should
System.out.println("tiden er: "+tid.asString());// gives 16:00 printed
for(int i=0;i>12;i++){
System.out.println("er i løkken");// gives nothing printed
tid.increaseMinutter(30);
System.out.println(tid.asString());// gives nothing printed
tider.add(tid.asString());
}
© Stack Overflow or respective owner