OOP (course 4): Static methods, Namespaces, Exceptions & Traits! Woh!
Traits: "Horizontal" Reuse
  Start your All-Access Pass to unlock this challenge
Buy Access Login

Challenge 1 / 1

In the previous challenge, we created a NameableItemTrait and used it inside of GasPlanet and SolidPlanet.

But, there was another option: create a new AbstractPlanet class, move the logic there, and then extend this class.

In this situation, what was a better option: using a trait or extending a base class?

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.