Question OOP-SOLID-0074
HardWhat is the main difference between the Strategy and State patterns?
- A.
State is a creational pattern
- B.
Strategy changes the object's class
- C.
Sign up free to see the answer and a step-by-step explanation.
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 is the main difference between the Strategy and State patterns?
State is a creational pattern
Strategy changes the object's class
Sign up free to see the answer and a step-by-step explanation.
In Strategy the client chooses the algorithm; in State the object switches its own behaviour as its state changes
They are identical