r/javahelp • u/Ok-Dealer-3051 • Mar 17 '26
why some exception need catch some not?
im a noobied in java recently i wondering why some throws-exception method like File#createNewFile() need a catch block but Interger.parseInt(String) no need a catch block. could any body anwser it?
5
Upvotes
View all comments
Show parent comment
5
u/8dot30662386292pow2 Mar 17 '26
I get what you mean, but just to point out there are no class called
CheckedException. Every Exception must be handled, unless it's aRuntimeExceptionor it's subclass.