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 / jeevan
It is a good programming practice to have only a sub set of
checked exceptions classes from the throws clause of the
inherited method of the superclass.
Here in the above example E2,E3 exception are not a subset
of the exception classes of the inherited method
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
What are peerless components?
How can I right-justify a string?
What is this keyword used for?
What is a method in coding?
Is there any way to skip finally block of exception even if some exception occurs in the exception block?
Can we have two main methods in a java class?
Can this keyword be used to refer static members?
What does a void function return?
What causes memory leaks in java?
What is the purpose of return statement?
In which language java is written?
What do you mean by order of precedence and associativity?
Can we have a try block without catch block?
What is hashset in java?
Difference between nested and inner classes ?