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
Can I overload to string method
What is function and its uses?
How do you sort objects in java?
What is prime number in java?
Is main a keyword in java?
Explain exception chaining in java?
Write java program to reverse string without using api?
What is concurrent hashmap and its features?
Differentiate between the constructors and methods in java?
What is ‘has a’’ relationship in java?
What does method mean?
What about instanceof operator in java?
What is a boolean structure?
Write a program to print all permutations of string?
What is quick sort in java?