Question OOP-ENC-0078
HardWhy is exposing a 'setId' method on an entity often a bad idea?
- A.
It breaks inheritance
- B.
Setters are slow
- 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
Encapsulation question
Why is exposing a 'setId' method on an entity often a bad idea?
It breaks inheritance
Setters are slow
Sign up free to see the answer and a step-by-step explanation.
IDs must be strings
An entity's identity should not change after creation