Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. try {
  2. ... // code that can throw IOException or some user-defined ParserException
  3. } catch(IOException) {
  4. e = new IOException(); // this is acceptable (although there is no point in doing it)
  5. e.printStackTrace();
  6. }
  7.  
  8. try {
  9. ... // code that can throw IOException or some user-defined ParserException
  10. } catch(IOException | ParserException e) {
  11. e = new IOException(); // this is NOT acceptable -- e may reference a ParserException
  12. e.printStackTrace();
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement