1.

Which of the following statements invoke the exception class?(a) throws new Exception();(b) throw new Exception();(c) new Exception();(d) new throws Exception();The question was asked in semester exam.My doubt stems from Exception Handling topic in portion Error Handling and Exception Handling in PHP of PHP

Answer»

The correct option is (b) throw new Exception();

To ELABORATE: throw new Exception(); trigger an exception and each “throw” MUST have at LEAST ONECATCH”.



Discussion

No Comment Found

Related InterviewSolutions