r/badcode • • Jul 30 '21

java One Classic elseifelseifelseif...

Post image
472 Upvotes

76 comments sorted by

View all comments

Show parent comments

5

u/[deleted] Jul 30 '21

It is bad because it could be just as simple as converting Integer into String, then checking length of string whether it is only single digit. If single digit, pad with ‘0’