I read the following A legal nonabstract implementing class has the following properties: ... - It must not declare any new checked exceptions for an implementation method. - It must not declare any checked exceptions that are broader than the exceptions declared in the interface method. ...
I have some problem understanding how you could fulfil the first but fail to fulfil the second?
Anyone that could explain (maybe with a simple code example) how these rules correlate?
Joined: Feb 07, 2005
Check comments in above code. Make changes according comments and see the result. Try to understand compiler error messages.
Joined: Feb 02, 2006
[ August 30, 2006: Message edited by: wise owen ]
Joined: Aug 23, 2006
Thanks guys. That did the trick. Now it is all crystal clear!
Joined: Aug 29, 2006
Non abstract implementation class can throw broader exceptions but not new surprise exceptions that are not in super class.
Awake Arise and Stop Not Till Your goal is reached