I am working on a java program that will be constructed by multiple methods, each with it's own try/catch blocks. I find myself duplicating the same catch block in each try block.
Is there any way to have multiple try blocks use a single catch block?
Thanks
put the shared logic in a common method and invoke it from each catch block.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With