Order of Exception Catch Clauses

Q

Does it matter in what order catch statements for FileNotFoundException and IOExceptipon are written?

✍: FYIcenter

A

Yes, it does. The FileNoFoundException is inherited from the IOException. Exception's subclasses have to be caught first.

2007-03-03, 6553👍, 0💬