File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Catch Exceptions With Appropriate Ways 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 » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Catch Exceptions With Appropriate Ways" Watch "Catch Exceptions With Appropriate Ways" New topic
Author

Catch Exceptions With Appropriate Ways

Richard Jackson
Ranch Hand

Joined: Jun 25, 2003
Posts: 128
Hi, every professionals

During the course of my programming,I just saw many reference books.
I found different ways to handle exceptions in assignment or other programs.

For instance,I write a simple method to close the data file.


I also write a method to make user seen the message dialog.


Please comment on this problem. Which one is more suitable to SCJD assignment? (Because of involved GUI representation...)

Regards, Richard


Regards, Richard
Itapaj� Takeguma
Ranch Hand

Joined: Jul 21, 2004
Posts: 41
For me, these options are pretty much the same. In both options, you tell the user that an error occured but gives no option to him.
I really think nothing could go wrong in:

public void closeFile(){
....
}

but if something happens to go wrong, I think you should give the user the option to get to a safe point.

Itapaj�.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Catch Exceptions With Appropriate Ways