Question OOP-SOLID-0022
EasyWhat does the Single Responsibility Principle say about a class?
- A.
It should have only one method
- B.
It should have one object
- C.
Show answer and explanation
Answer: D
Each class should focus on one job.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
SOLID and Design Principles question
What does the Single Responsibility Principle say about a class?
It should have only one method
It should have one object
Answer: D
Each class should focus on one job.
It should be used only once
It should have only one reason to change