Top 350+ Solved Advance PHP MCQ Questions Answer
Q. ---methods can be overridden by redefining the methods (use the same name) in thechild class.Sol:
a. inheritance
b. public
c. protected
d. private
Q. The----keyword can be used to prevent class inheritance or to prevent methodoverridingSol:
a. final
b. constants
c. const
d. case-sensitive
Q. ------cannot be changed once it is declared.Sol:
a. final
b. constants
c. const
d. case-sensitive
Q. Class constants can be useful if you need to define some-------data within a classSol:
a. final
b. constants
c. const
d. case-sensitive
Q. A class constant is declared inside a class with the-----keyword.Sol:
a. final
b. constants
c. const
d. case-sensitive
Q. Class constants are--------However, it is recommended to name the constants in alluppercase letters.Sol:
a. final
b. constants
c. const
d. case-sensitive
Q. We can access a-------from outside the class by using the class name followed by thescope resolution operator (::) followed by the constant nameSol:
a. final
b. constant
c. const
d. case-sensitive
Q. -------classes and methods are when the parent class has a named method, but need itschild class(es) to fill out the tasksSol:
a. abstract
b. child
c. interface
d. implement
Q. An------class is a class that contains at least one abstract methodSol:
a. abstract
b. child
c. interface
d. implement
Q. An------method is a method that is declared, but not implemented in the code.Sol:
a. abstract
b. child
c. interface
d. implement
Q. An abstract class or method is defined with the------keyword:Sol:
a. abstract
b. child
c. interface
d. implement
Q. When inheriting from an------class, the child class method must be defined with thesame nameSol:
a. abstract
b. child
c. interface
d. implement
Q. if the-----method is defined as protected, the child class method must be defined aseither protected or public, but not privateSol:
a. abstract
b. child
c. interface
d. implement
Q. The----class method must be defined with the same name and it re declares the parentabstract methodSol:
a. abstract
b. child
c. interface
d. implement
Q. The-----class method must be defined with the same or a less restricted access modifierSol:
a. abstract
b. child
c. interface
d. implement