InterviewSolution
Saved Bookmarks
| 1. |
Which are the two blocks that are used to check error and handle the error?(a) Try and catch(b) Trying and catching(c) Do and while(d) TryDo and CheckThe question was asked in a national level competition.This interesting question is from Exception Handling topic in section Exception Handling & Static Class Members of Object Oriented Programming |
|
Answer» RIGHT answer is (a) Try and catch To explain: TWO blocks that are used to CHECK for errors and to handle the errors are try and catch block. The code which might produce some EXCEPTIONS is placed INSIDE the try block and then the catch block is written to catch the error that is produced. The error message or any other processing can be done in catch block if the error is produced. |
|