Created
February 1, 2012 12:32
-
-
Save ldaniel/1716822 to your computer and use it in GitHub Desktop.
Multiple catch blocks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
// codigo que pode gerar IOException | |
} | |
catch (FileNotFoundException e){ | |
// tratamento | |
} | |
catch (IOException e){ | |
// tratamento | |
} | |
///////////////// cuidado: code bad smell | |
try { | |
} | |
catch (SqlException e){ | |
// tratamento | |
} | |
catch (DivisionByZeroException e){ | |
// tratamento | |
} | |
catch (FileNotFoundException e){ | |
// tratamento | |
} | |
catch (IOException e){ | |
// tratamento | |
} | |
catch (Exception e){ | |
// tratamento | |
} | |
///////////////// cuidado: code bad smell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment