InterviewSolution
Saved Bookmarks
| 1. |
To catch more than one exception in one catch block, how are the exceptions separated in the syntax?(a) Vertical bar(b) Hyphen(c) Plus(d) ModulusThe question was posed to me in an internship interview.I need to ask this question from Catching Class Types topic in portion Exception Handling & Static Class Members of Object Oriented Programming |
|
Answer» CORRECT choice is (a) VERTICAL bar To EXPLAIN I would say: Just the way we separate the ARGUMENTS in a function definition using comma. Here we separate the exceptions by using a vertical bar or we call it pipe symbol SOMETIMES. This is just a convention followed to separate different exception list. |
|