1.

If one intends to create a model that will be assumed by anumber of closely related objects, which class must be used?(a) Normal class(b) Static class(c) Abstract class(d) InterfaceI got this question in an international level competition.This is a very interesting question from Advanced Object-Oriented PHP in chapter Object-Oriented PHP of PHP

Answer»

Correct choice is (c) Abstract class

To explain: The abstract classes are the classes in which at least ONE method need to be abstract. Abstract classes in PHP are declared with the help of KEYWORD abstract. The use of class abstract are that all base classes implementing abstract class should give implementation of abstract methods declared in parent class.



Discussion

No Comment Found

Related InterviewSolutions