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 generic class?
Does substring start with 0?
what is singleton class in java?
what is deadlock? : Java thread
Explain how hashmap works?
Convert Binary tree to linked list.
Is namespace same as package in java?
How is the marker interface used in Java?
How the metacharacters are different from the ordinary characters?
Hi Anyone know the model / questions of the Federal bank sample questions for the post of Specialist Officers - Programmers. Please post if anyone have..
Differences between C and Java?
Which number is denoted by leading 0x or 0x in java?
What is type safety in java?
Can I use % with real numbers?
What is the difference between ArrayList and Vector? which one is better in Java