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 the difference between throw and throws?
What are predicates in java 8?
In Java, what types of classes perform inheritance?
What is default size of arraylist in java?
What is difference between local variable and global variable?
How do you clear a list in java?
Can substring create new object?
How does hashmap work in java ?
Can we declare a class as static?
what is the use of custom tags? with example?
Can a class extend more than one class?
What are the different types of collections in java?