Java while loop being incremented without a condition

Viewed 25

Please someone help me to understand the code in Java.I don't understand how "count" is being incremented without its condition?

public class Test {
    static int count = 0;
    int i = 0;
    public void changeCount() {
        while (i < 10) {
            i++;
            count++;
        }
    }
}
public class Main {
    public static void main(String[] args) {
        Test check1 = new Test();
        Test check2 = new Test();
        check1.changeCount();
        check2.changeCount();
        System.out.print(check1.count + " : " + check2.count);
    }
}
0 Answers
Related