Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Could someone tell me where to find the information for this question?

 
kenny gill
Ranch Hand
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The question I'm being asked:

I do not want to look at documentation to see if the methods I use cause exceptions. If there is a problem, there are two distinct ways that Java will let me know. What are they?
 
Ishan Pandya
Ranch Hand
Posts: 225
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess they are "catch" and "throws".
 
Campbell Ritchie
Sheriff
Pie
Posts: 47292
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You do need to look at the documentation, which should tell you. Look at this constructor and this method, for example. Note the unchecked Exception in one case appears only in the Javadoc and the checked Exception in the other case appears as a throws clause, too.
Note that unexpected unchecked Exceptions might not be listed at all; if you pass 0 and suffer an ArirthmeticException, that might not be anticipated or recorded.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic