Podcast
Questions and Answers
According to the Open Closed Principle, a module should be:
According to the Open Closed Principle, a module should be:
- open for both extension and modification
- open for extension but closed for modification (correct)
- closed for both extension and modification
- closed for extension but open for modification
The key to the Open Closed Principle is:
The key to the Open Closed Principle is:
- abstraction (correct)
- inheritance
- polymorphism
- encapsulation
According to the Liskov Substitution Principle, subclasses should be:
According to the Liskov Substitution Principle, subclasses should be:
- substitutable for their base classes (correct)
- distinct from their base classes
- superior to their base classes
- independent of their base classes
The Liskov Substitution Principle ensures that passing an instance of a derived class to a function expecting an instance of its base class:
The Liskov Substitution Principle ensures that passing an instance of a derived class to a function expecting an instance of its base class:
The Open Closed Principle emphasizes on:
The Open Closed Principle emphasizes on: