OOP (course 3): Inheritance, Abstract Classes, Interfaces and other amazing things
Extends
  Unlock this challenge
Login Register

Challenge 1 / 1

Look at these two classes:

class Ship
{
    public function getName()
    {
        return 'Starfighter';
    }
}
class JediShip extends Ship
{
    public function getFavoriteJedi()
    {
        return 'Yoda';
    }
}

Suppose we instantiate both objects:

$ship = new Ship();
$jediShip = new JediShip();

Which of the following lines will cause an error?

Skip challenges and go to theNext Chapter

Turn Challenges Off?

All further challenges will be skipped automatically.
You can re-enable challenges at any time on this page or from your account page.