CS Electrical And Electronics
@cselectricalandelectronics

Which of the following statements describe the Open/Closed Principle of the SOLID object-oriented design approach?

All QuestionsCategory: Cpp LanguageWhich of the following statements describe the Open/Closed Principle of the SOLID object-oriented design approach?
Anonymous asked 3 years ago

Options:

  1. High-level modules should depend on low-level modules
  2. Modifying existing classes should be avoided
  3. Changes made to existing classes are unlikely to affect the rest of the library
  4. Inheritance should be used to add new features
  5. A class should be open for extension but closed for modification
1 Answers
Best Answer
Anonymous answered 3 years ago

The correct answers are:

  1. Modifying existing classes should be avoided
  2. Inheritance should be used to add new features
  3. A class should be open for extension but closed for modification