aspose file tools
The moose likes Beginning Java and the fly likes Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Reply 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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Exception
 
Similar Threads
Exception question
finally
try-catch-finally ( when and how to close files ??)
Question on finally
Exception Question