Why does this create an infinite loop if the condition is stated?
package com.codegym.task.task06.task0613;
/*
Cat and statics
*/
public class Solution {
public static void main(String[] args) {
while(Cat.catCount < 10){
Cat cat = new Cat();
}
System.out.println(Cat.catCount);
// Create 10 cats
// Display the value of the variable catCount
}
public static class Cat {
public static int catCount = 0;
public Cat(){
catCount ++;
};
// Create a static variable catCount
// Declare a constructor
}
}