class A{
some variables;
public void a()throws Excepion1,Exception2{....}
}
class B extends A{
variables...
public void a()throws E2,E3{.....}
}
Qns:
here override of methods occurs or not,ore else wil give
any compilation error or run properly..plz tell me briefly
whts happening with the above codes....
Answer Posted / anjan singh
while overriding, you must keep in mind that the exception
being thrown by overriding method(method in subclass)
should not throw a broader exception than what is already
thrown by method in super class. one exception is that, you
can always throw RuntimeException from method in subclass.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the exact difference in between Unicast and Multicast object?
What is javac in java?
Can I uninstall java?
What are the types of java languages?
What is the use of protected in java?
What is the final class modifier?
What is the difference between stored procedure & function?
What are the rules for naming an array?
What is the difference between double and float variables in java?
Can a method inside a interface be declared as final?
What is java Applet?
Is java a virus?
Are static members inherited to sub classes?
Explain the JDB in depth & command line.
What are some examples of variable costs?