Hi,
The variable count is equal to 3 before the if expression
is evaluated, so the short circuit operator rule that the
right hand side is not evaluated holds in this case as
well. Please replace the void
test() method with:
Running the main will result in:
C:\projects\misc>java BoolArray
b[0] = true
b[1] = false
b[2] = true
Before If count = 3
After If count = 3
Does this answer your question?
Cheers,
Gian Franco Casula