by
0
5
3,008
2
Top 1% !
Popular
Famous
Specified
OpenSource
Popularity: 4767th place
Created
Modified Aug 20, 2013

Published on:

No tags for this snippet yet.
JVMjre7
LanguageJava
LicenseMIT_X11

New try-catch block syntax

Starting from java 7, try catch blocks can be written in a more strict way...
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/9411/New-try-catch-block-syntax?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
try { //my instructions here... } catch(RuntimeException e, Exception e1) { System.err.println("Generic exception"); if (e != null) e.printStrackTrace(); if (e1 != null) e1.printStrackTrace(); }
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus