What is the multi-catch block in java?



What is the multi-catch block in java?..

Answer / Tara Datt Joshi

The multi-catch block in Java allows catching multiple exceptions in a single catch block. It is defined using multiple catch clauses, separated by the | symbol. When executing, the JVM checks each catch clause from top to bottom until it finds an exception that matches the thrown exception. If no match is found, the program throws a RuntimeException.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

how to make a un-checked exception as a checked exception one.

2 Answers  


What is keyset in java?

1 Answers  


What is the top class of AWT event hierarchy?

5 Answers  


Java does not support multiple inheritance. how interface helps in the same?

5 Answers   TCS,


What does regex mean?

1 Answers  


What is percentage in java?

1 Answers  


What are the override methods in Object class?

2 Answers   Tech Mahindra, Wipro,


what is the difference between yielding and sleeping? : Java thread

1 Answers  


what is the purpose of the wait(), notify(), and notifyall() methods? : Java thread

1 Answers  


What is generic class?

1 Answers   Tech Mahindra,


Why we use static and synchronized in method for single thread model example: public static synchronized add(){}

2 Answers  


Why is an interface be able to extend more than one interface but a class can’t extend more than one class?

1 Answers  


Categories