wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "User-defined Exception class" Watch "User-defined Exception class" New topic

User-defined Exception class

mi te

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

Joined: Feb 05, 2001
Posts: 17249

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.


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

Joined: Oct 01, 2001
Posts: 2835

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

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
Subtract 2 Dates
Comparing two date inputs
public boolean equals (Object obj)
Custom Date class and Appointment class