aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes User-defined Exception class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "User-defined Exception class" Watch "User-defined Exception class" New topic
Author

User-defined Exception class

mi te
Greenhorn

Joined: Mar 09, 2006
Posts: 29
Could you read the following code below?


This runs ok, but I wanted to make sure this the prefered way of writing a user-defined exception class. The question I am asking is that is it better not to override the method getMessage() of Exception class?

Please someone be kind and reply.

[ March 13, 2006: Message edited by: Mark Spritzler ]
[ March 13, 2006: Message edited by: Mark Spritzler ]
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Looks much easier to read when I put in the CODE tags, that you can put in when you click the CODE button under the Add Reply button when posting messages on this board.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2771
    
  10

I would say there's no particular reason to override getMessage(), so why do it?
mi te
Greenhorn

Joined: Mar 09, 2006
Posts: 29
Yeah, to be honest why I bothered overriding.... I ought t o have a strong cup of coffee.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: User-defined Exception class
 
Similar Threads
NEED HELP
public boolean equals (Object obj)
Custom Date class and Appointment class
Subtract 2 Dates
Comparing two date inputs