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());
    }
                You mean less than, not greater than:
for(int i=0;i<12;i++){ 
//           ^
                        You condition is wrong:
Change i>12 to i<12.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With