Java / Exception
Can we use FileNotFoundException and IOException in Java multi catch?
No. You will get compile time exception, "The exception FileNotFoundException is already caught by the alternative IOException". This is because FileNotFoundException is a subclass of IOException. To fix it, use single catch statements for these exceptions.
More Related questions...