Why is the output 10 and not 9?. According to my understanding the count value is assign to b. Then the count value increment. Hence the output should be 9 instead of 10. However in this case the output is 10. Why?.
package com.nowhere.blogger.core.junit;
public class Bunnies {
static int count = 0;
Bunnies(){
while(count < 10) new Bunnies(++count); //prefix
}
Bunnies(int x) {super();}
public static void main(String[] args){
new Bunnies();
new Bunnies(count);
int b = count++; //postfix
System.out.println(b);
}
}