Java If Statement In For Loop Prints Multiple Times Stack Overflow

Java If Statement In For Loop Prints Multiple Times Stack Overflow