This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund 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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply 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: 17233
    
    1

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
Bartender

Joined: Oct 01, 2001
Posts: 2539
    
  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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: User-defined Exception class
 
Similar Threads
Custom Date class and Appointment class
Subtract 2 Dates
Comparing two date inputs
public boolean equals (Object obj)
NEED HELP