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?
Gowher Naik
Ranch Hand
Joined: Feb 07, 2005
Posts: 643
posted
0
Check comments in above code. Make changes according comments and see the result. Try to understand compiler error messages.
wise owen
Ranch Hand
Joined: Feb 02, 2006
Posts: 2023
posted
0
[ August 30, 2006: Message edited by: wise owen ]
Hans Beck�rus
Greenhorn
Joined: Aug 23, 2006
Posts: 24
posted
0
Thanks guys. That did the trick. Now it is all crystal clear!
joy peter
Greenhorn
Joined: Aug 29, 2006
Posts: 13
posted
0
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