Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
Define what a mixin is in object-oriented programming.
Think about small classes that add functionality.
Explain the main advantage of using composition over inheritance.
Consider how objects relate to one another.
What is a mixin?
Remember, they add functionality!
True or False: Composition promotes 'is-a' relationships.
Think about the relationship types.
Create a class that represents a Bicycle which can use a GearMixin to manage its gears, and describe how you would implement this.
Think about how bikes work with gears.
Design a system where a Robot class has a WeaponMixin, and can use various types of weapons through composition.
Focus on how you can mix different functionalities.
5 more questions in this section. Enroll free to practise them all.
Enroll free