I have the method signature which looks like below
I want to override this method .Please, let me know the restrictions on the throws list(Exception list) of the overidden method.I want to know the possible combination of throws exceptions of the overiding method.
No, I think it's still a beginner topic. Overriding is pretty fundamental in Java; you can't advance without knowing how it works. I'm not saying it's easy, necessarily. But it is a requirement for beginners to understand. Even if the overridden method throws an exception.
Do you understand checked exceptions? Basically, your overriding method cannot throw any new checked exceptions. You can throw any unchecked exception you want, and you can throw anything that was declared in the overridden method's throws statement, or any subclass of what was declared there. You can also throw less than was declared there. Your overriding method may even throw no checked exceptions at all - and thus, it has no need to declare anything.
posted 8 years ago
I'm not dead! I feel happy! I'd like to go for a walk! I'll even read a tiny ad: