nerdexam
Zend

200-530 · Question #410

Maria creates an application using PHP script. The application contains certain classes. The class design requires that a particular member variable must be directly accessible to any subclass of…

The correct answer is B. Mark the variable as protected. See the full explanation below for the reasoning.

Question

Maria creates an application using PHP script. The application contains certain classes. The class design requires that a particular member variable must be directly accessible to any subclass of this class. What should Maria do to achieve this?

Options

  • AMark the variable as private.
  • BMark the variable as protected.
  • CMark the variable as public.
  • DMark the variable as final.

How the community answered

(24 responses)
  • A
    8% (2)
  • B
    83% (20)
  • C
    4% (1)
  • D
    4% (1)

Community Discussion

No community discussion yet for this question.

Full 200-530 Practice