aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Relationship between Exceptions [Tricky] 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 "Relationship between Exceptions [Tricky]" Watch "Relationship between Exceptions [Tricky]" New topic
Author

Relationship between Exceptions [Tricky]

Ashish Agrawal
Ranch Hand

Joined: Nov 02, 2003
Posts: 112
Will this code give any compile time error? Why?



Thanks,
Ashish Agrawal
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
You could answer the first question by actually trying to compile it, couldn't you? That would certainly help in one's quest for understanding.


"I'm not back." - Bill Harding, Twister
Ashish Agrawal
Ranch Hand

Joined: Nov 02, 2003
Posts: 112
Maybe this will help.

http://www-2.cs.cmu.edu/~pattis/15-1XX/15-200/lectures/exceptions/lecture.html

Regards,
Ashish A
[ April 12, 2005: Message edited by: Ashish Agrawal ]
challa
Greenhorn

Joined: Mar 28, 2005
Posts: 23
Ashish,

A method overrided in subclass can throw the checked exceptions or its subclasses thrown by the method in the super classes or it need not throw any exception. This rule is not applicable to unchecked exception.

In your code classnotfoundexception is a checked exception and runtime exception is unchecked exception.

hope it is clear.
 
Consider Paul's rocket mass heater.
 
subject: Relationship between Exceptions [Tricky]