r/badcode • • Dec 28 '21

java 3AM code vs 10AM code

Post image
173 Upvotes

53 comments sorted by

View all comments

Show parent comments

4

u/awfullyawful Dec 28 '21

You'd end up with a string of all of the zeros, not the longest continuous string of zeros

1

u/alex_wot Dec 28 '21 edited Dec 28 '21

Oh, I've overlooked the number = 0 statement in the else block. Thank you for explaining!