1.

Which one of the following keyword is used to inherit our subclass into a superclass?(a) extends(b) implements(c) inherit(d) includeI got this question in semester exam.This question is from Basics of Object-Oriented PHP- 2 topic in section Object-Oriented PHP of PHP

Answer»

The correct option is (a) extends

Explanation: When we EXTEND a CLASS then the subclass will INHERIT all the public and PROTECTED methods from the parent class.

The keyword IMPLEMENTS are used with interfaces. With inheritance, we use the keyword extends.



Discussion

No Comment Found

Related InterviewSolutions