|
-
Extending exception class... ?
Alright i need to make a class for a Java Applet which throws an exception if a number is >0 or <10. I think i have to extend the exception class to do this but im not sure what i should put in my class if i do this... Anyway, someone mind giving me a hand?
-Kli
[This message has been edited by Klion (edited December 02, 2001).]
-
Ursus Arctos Moderatis
If you want to handle the Exception right then and there, than you could simply put the statement into a Try / Catch block.
If you'd rather have your Class throw the Exception, than simply add "throws Exception" or "throws ArithmeticException" to your class definition.
Example:
public class SharkyForums throws Exception{
....
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|