Pakistan's best MCQs practice hub — FPSC · PPSC · CSS · NTS · Other Exams
Login

The Law of Demeter (Principle of Least Knowledge) states that an object’s method should only invoke methods of:

AAny global object anywhere in the application
BItself, its parameters, objects it instantiates, and its immediate direct component fields
CSubclasses located 3 levels deep in the inheritance tree
DRemote microservices without authentication

Explanation

The Law of Demeter restricts method call chains to immediate neighbors to prevent tight structural coupling.

Submitted by: mcqstutor Team More Software Engineering MCQs →

No Comments

Leave a comment

Your email address will not be published. Required fields are marked *