nerdexam
Zend

200-550 · Question #121

In the following code, which classes can be instantiated? abstract class Graphics { abstract function draw($im, $col); } abstract class Point1 extends Graphics { public $x, $y; function…

The correct answer is C. Point2. See the full explanation below for the reasoning.

Question

In the following code, which classes can be instantiated? abstract class Graphics { abstract function draw($im, $col); } abstract class Point1 extends Graphics { public $x, $y; function __construct($x, $y) { $this->x = $x; $this->y = $y; } function draw($im, $col) { ImageSetPixel($im, $this->x, $this->y, $col); } } class Point2 extends Point1 { } abstract class Point3 extends Point2 { }

Options

  • AGraphics
  • BPoint1
  • CPoint2
  • DPoint3
  • ENone, the code is invalid

How the community answered

(27 responses)
  • A
    4% (1)
  • B
    7% (2)
  • C
    70% (19)
  • D
    15% (4)
  • E
    4% (1)

Community Discussion

No community discussion yet for this question.

Full 200-550 Practice