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
how we can create packages in java?
Is c better than java?
What is struts in java?
Why is java so popular?
What is linked hashset and its features?
What is not thread safe?
v-model life cycle
what happens when a thread cannot acquire a lock on an object? : Java thread
What is the major drawback of internal iteration over external iteration?
What is object english?
What is the difference between interface & abstract class?
What is regex used for?
Compare java and python.
What is array command?
When wait(), notify(), notifyall() methods are called does it releases the lock or holds the acquired lock?