r/badcode • • Nov 13 '20

java Getting Digits using Switch Catch

Post image
881 Upvotes

52 comments sorted by

View all comments

1

u/Kllngii Nov 14 '20

The thing that bothers me most is that the type of in is string, not char, yet its evaluate digit not digits. Also -1 will never be returned but this is totally fine to spot errors while coding.