Top 350+ Solved Advance PHP MCQ Questions Answer

From 121 to 135 of 320

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

  • a. inheritance

Q. The----keyword can be used to prevent class inheritance or to prevent methodoverridingSol:

a. final

b. constants

c. const

d. case-sensitive

  • a. final

Q. ------cannot be changed once it is declared.Sol:

a. final

b. constants

c. const

d. case-sensitive

  • b. constants

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

  • b. constants

Q. A class constant is declared inside a class with the-----keyword.Sol:

a. final

b. constants

c. const

d. case-sensitive

  • c. const

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

  • d. case-sensitive

Q. An------class is a class that contains at least one abstract methodSol:

a. abstract

b. child

c. interface

d. implement

  • a. abstract

Q. An------method is a method that is declared, but not implemented in the code.Sol:

a. abstract

b. child

c. interface

d. implement

  • a. abstract

Q. An abstract class or method is defined with the------keyword:Sol:

a. abstract

b. child

c. interface

d. implement

  • a. abstract

Q. When inheriting from an------class, the child class method must be defined with thesame nameSol:

a. abstract

b. child

c. interface

d. implement

  • a. abstract

Q. The-----class method must be defined with the same or a less restricted access modifierSol:

a. abstract

b. child

c. interface

d. implement

  • b. child
Subscribe Now

Get All Updates & News