1.

If your object must inherit behavior from a number of sources you must use a/an(a) Interface(b) Object(c) Abstract class(d) Static classThe question was asked in class test.Question is from Advanced Object-Oriented PHP topic in chapter Object-Oriented PHP of PHP

Answer»

Correct answer is (a) INTERFACE

Easy explanation: An interface in PHP consists of METHODS that have no implementations, i.e. the interface methods are abstract methods. The methods in the interfaces must have public VISIBILITY scope. The interfaces are DIFFERENT from classes as the class can inherit from one class only whereas the class can IMPLEMENT one or more interfaces.



Discussion

No Comment Found

Related InterviewSolutions