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 mean by collections in java?
Is 0 a real number?
What are pass by reference and pass by value?
What are the notations in Java?
Does it matter in what order catch statements for filenotfoundexception and ioexception are written?
What is string in java?
How do you declare an infinite loop?
Why do we need to override equals() and hascode() method of object class?
What is the use of arraylist class in java?
What happens when I use / and % with a negative numerator?
What is the root class for all Java classes?
Explain the Propertie sof class?