Top 350+ Solved Advance PHP MCQ Questions Answer
Q. The number of required arguments must be the same. However, the-----class may haveoptional arguments in additionSol:
a. abstract
b. child
c. interface
d. implement
Q. -----make it easy to use a variety of different classes in the same way. When one ormore classes use the same interface, it is referred to as "polymorphism"Sol:
a. abstract
b. child
c. interface
d. implement
Q. Interfaces are declared with the------keyword.Sol:
a. abstract
b. child
c. interface
d. implement
Q. ------cannot have properties, while abstract classes canSol:
a. abstract
b. child
c. interface
d. implement
Q. All------methods must be public, while abstract class methods is public or protectedSol:
a. abstract
b. child
c. interface
d. implement
Q. All methods in an-----are abstract, so they cannot be implemented in code and theabstract keyword is not necessarySol:
a. abstract
b. child
c. interface
d. implement
Q. To implement an interface, a class must use the-------keyword.Sol:
a. abstract
b. child
c. interface
d. implement
Q. A class that implements an interface must------all of the interface's methods.Sol:
a. abstract
b. child
c. interface
d. implement
Q. PHP only supports---------a child class can inherit only from one singleSol:parent.
a. abstract
b. child
c. interface
d. single inheritance
Q. class needs to inherit multiple behaviors? OOP------is used to solve this problem.Sol:
a. static
b. self
c. traits
d. single inheritance
Q. ------are used to declare methods that can be used in multiple classes. Traits can havemethods and abstract methods that can be used in multiple classes.Sol:
a. static
b. self
c. traits
d. single inheritance
Q. ------methods can be called directly - without creating an instance of the class first.Sol:
a. static
b. self
c. traits
d. single inheritance
Q. Static methods are declared with the------keywordSol:
a. static
b. self
c. traits
d. single inheritance