InterviewSolution
Saved Bookmarks
| 1. |
Which among the following is not a method of Throwable class?(a) public String getMessage()(b) public Throwable getCause()(c) public Char toString()(d) public void printStackTrace()This question was posed to me in an internship interview.Enquiry is from Exception Handling topic in division Exception Handling & Static Class Members of Object Oriented Programming |
|
Answer» CORRECT CHOICE is (c) public Char TOSTRING() The best I can explain: Actually all the functions are available in throwable class. But the return type given in the option is WRONG. The function toString RETURNS string value. Hence the return type must be a String and not a char. |
|