Why doesn’t the post increment operator work on a method that returns an int?
i++ is an assignment to a variable i. In your case, zero++ is an equivalent to zero = zero + 1. So 0++ would mean 0 = 0 + 1, which makes no sense, as well as getInt() = getInt() + 1. More accurately : int oneA = zero++; means int oneA = zero; zero … Read more