You are developing a system where you have multiple classes, and you want to ensure that a particular set of methods is available in all these classes. How would you ensure this?
- Use Composition
- Use Encapsulation
- Use Inheritance
- Use Polymorphism
To ensure that a particular set of methods is available in multiple classes, you would use Inheritance. Inheritance allows a class to inherit properties and methods from another class, making it possible to create a base class with common methods that are shared by multiple derived classes.
Loading...
Related Quiz
- Python's ____ allows classes to be created dynamically, at runtime.
- How can you run a specific test method from a test case in unittest?
- How do you create an empty set in Python?
- In Python, the ____ method is used to get the number of elements in a set.
- Which method in a class is responsible for deleting an attribute?