1.

Which one of the following methods in the exception class, is used to get a nested exception object?(a) getPrevious()(b) getCode()(c) getFile()(d) getLine()This question was posed to me during an interview for a job.Origin of the question is Object Advanced Features in section Objects and Databases in PHP of PHP

Answer»

Right option is (a) GETPREVIOUS()

The explanation: getCode() – GET the CODE integer that was PASSED to the constructor. getFile() – Get the file in which the EXCEPTION was generated. getLine() – Get the line number at which the exception was generated.



Discussion

No Comment Found

Related InterviewSolutions