File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "exception" Watch "exception" New topic
Author

exception

mandy fern
Greenhorn

Joined: Aug 21, 2001
Posts: 12
How do I write an exception class for a wrong isbn number format?
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
What are the rules for editing an ISBN number format?


"JavaRanch, where the deer and the Certified play" - David O'Meara
mandy fern
Greenhorn

Joined: Aug 21, 2001
Posts: 12
The rules are 2 numbers space 2 numbers space 3 numbers space 3 numbers
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Actually, the exception class would not need to do much except print an error message. Here is a sample (I stole the code from IOException)

It does almost nothing.
What you probably want is an ISBN class that has a constructor or a validate() method that throws the ISBNException.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: exception
 
Similar Threads
void return type in JSP expression
counting algorithm
Java ranch rules roundup
WA #1.....word association
why JMX can not stop