Meaningless Drivel is fun!*
The moose likes Beginning Java and the fly likes Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Exception" Watch "Exception" New topic
Author

Exception

V Bose
Ranch Hand

Joined: Jul 10, 2003
Posts: 113

True or False-
Assuming Line 6 throws a FileNotFoundExcepton, Would line 13 throw a Null Pointer exception?
OR if things go fine up until Line 12 and Line 13 throws an IOException, will the JVM stop with an IOException?
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
IOExceptions will never force the JVM to stop because it is a checked exception and must be handled somewhere by your program in order to even be compiled and run. As for the NullPointerException: you should check to see if it is null and open before you attempt to close it.


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception