What will happen if we write code like:
try{}catch(exception e)catch(IOException i)
Answers were Sorted based on User's Feedback
Answer / maurice johnson
Ignoring the incorrect syntax of the Try\Catch Block, it
will never reach the IOException portion of the
Catch......the first catch will always be triggered due to
it only Catching type Exception.
Is This Answer Correct ? | 12 Yes | 3 No |
Answer / jahri
yes it should be child exception to base exception
Is This Answer Correct ? | 4 Yes | 1 No |
Answer / mathi
Ignoring the incorrect syntax of the Try\Catch Block, it
will never reach the IOException portion of the
Catch......the first catch will always be triggered due to
it only Catching type Exception.
Is This Answer Correct ? | 1 Yes | 1 No |
what is difference between method overloading & method overridding with example?
Can an interface extands a class?
What is the loop in java?
What is wrapper class html?
What is Classloader in Java?
What is the difference between assignment and initialization?
Which is bigger double or float?
What is byte [] in java?
What is definition and declaration?
How do I start learning java?
What do you mean by a JVM?
If an object is garbage collected, can it become reachable again?