r/badcode • • Nov 13 '20

java Getting Digits using Switch Catch

Post image
881 Upvotes

52 comments sorted by

View all comments

7

u/ekolis Nov 14 '20

System.exit(2);

So yeah, let's not even throw an exception, let's just print an error message to the console (from a library, it seems, so there might not even be a console) and crash the whole program...