This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes problem with catch and finally Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "problem with catch and finally" Watch "problem with catch and finally" New topic
Author

problem with catch and finally

Angela lewis
Ranch Hand

Joined: Mar 01, 2004
Posts: 100


If Hello.txt does not exist then the output would be

No such file found
Doing finally
-1

Why isn't it
No such file found
Doing finally
-1

Thanks
Swamy Nathan
Ranch Hand

Joined: May 16, 2004
Posts: 187
Something seems to be wrong with the question (I think)?
Looluo Zhu
Greenhorn

Joined: Nov 26, 2003
Posts: 8
I think the question should be

No such file found
Doing finally
0

Why isn't it
No such file found
Doing finally
-1


and this thread has the answer.


SCJP 1.4
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: problem with catch and finally
 
Similar Threads
try catch block
exCeption
Exceptions
Doubt regarding FileInputStream
static methods