1.

Which one of the following is the correct abstract method?(a) public function write()(b) abstract function write()(c) abstract public write();(d) abstract public function write();I have been asked this question in an interview.I'm obligated to ask this question of Object Advanced Features in chapter Objects and Databases in PHP of PHP

Answer»

The correct CHOICE is (d) abstract PUBLIC function write();

The explanation: An abstract method cannot have an implementation. You DECLARE it in the normal way, but end the DECLARATION with a semicolon RATHER than a method body.



Discussion

No Comment Found

Related InterviewSolutions