Question OOP-ENC-0072
HardWhat does the Law of Demeter discourage?
- A.
Writing constructors
- B.
Long chains like a.getB().getC().doThing() that depend on distant objects' structure
- 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
What does the Law of Demeter discourage?
Writing constructors
Long chains like a.getB().getC().doThing() that depend on distant objects' structure
Sign up free to see the answer and a step-by-step explanation.
Private fields
Using interfaces