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 declaration statement?
Can the garbage collection be forced by any means?
Write java program to reverse string without using api?
Why arraylist is used in java?
Compare Mutex and Semaphore in java.
What do you understand by casting in java language?
What is reverse function?
What is the difference between object oriented programming language and object based programming language?
What are sets in java?
Can an interface have a class?
Why to use nested classes in java? (Or) what is the purpose of nested class in java?
What is array sorting in java?
Can list contain null in java?
Is Java a dying language?
Can arraylist contain null values?