Hire QA – Specialized in QA Recruitment, Technical Interviews and Testing Solutions

Can we have an empty catch block?

Category: Java

We can have an empty catch block but it’s the example of worst programming. We should never have empty catch block because if the exception is caught by that block, we will have no information about the exception and it wil be a nightmare to debug it. There should be at least a logging statement to log the exception details in console or log files.

Leave a Reply

Your email address will not be published. Required fields are marked *