Any of the popular search engines will provide a wealth of code examples. What did you find?
Again for proper use of the methods you should get in the habit of consulting the documentation and a search engine first.
Try blocks can have multiple catch blocks.
Try {
somethingRisky();
doSomethingElseRisky();
doTheThirdRiskyActivity();
}
catch(theFirstRisk tfr) {
reportOops();
}
catch(theSecondRisk tsr) {
reportOops();
}
catch(theThirdRisk ttr) {
reportOops();
}
Also see the
try-with-resources and surrounding pages.