This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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

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: 17271

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: 2926

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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: User-defined Exception class
It's not a secret anymore!