aspose file tools*
The moose likes Beginning Java and the fly likes Could someone tell me where to find the information for this question? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Could someone tell me where to find the information for this question?" Watch "Could someone tell me where to find the information for this question?" New topic
Author

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

kenny gill
Ranch Hand

Joined: Mar 12, 2012
Posts: 54

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

Joined: Feb 06, 2012
Posts: 223

I guess they are "catch" and "throws".


OCPJP
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 40052
    
  28
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.
 
jQuery in Action, 2nd edition
 
subject: Could someone tell me where to find the information for this question?