Java while loop random crashes [duplicate]

Check again. If val is exactly 8, your condition:

if ((size/2)<val)

Does not run, since 8!<8. Presumably you want:

if ((size/2)<=val)

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top