JavaLanguage
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   chandra_sekhar
Posted On:   Wednesday, November 16, 2005 12:35 PM

Give me an example and explain Userdefined Exceptions?

Re: JavaLanguage

Posted By:   WarnerJan_Veldhuis  
Posted On:   Wednesday, November 16, 2005 05:11 PM

A userdefined exception is an exception which the user (you) defines.... That is the easy part. The hard part is to decide where you extend from:

1) Exception: makes it a checked exception

2) RuntimeException: makes it a unchecked exception

3) Error: which is generally not used by the programmer, but indicates major panic :)




There is some excellent information in the, how surprisingly, documentation. Found here for Throwable, or here for Error and here for Exception.




Please make sure you say hi from me to your teacher/professor. I like him, he is good. Although he should teach his students to think first, and not have the solution presented on a serving tray (by asking solutions to homework on forums)....
About | Sitemap | Contact