Consider the following scenario: You are designing a complex object-oriented system in Java, and you want to
Question:
Consider the following scenario:
You are designing a complex object-oriented system in Java, and you want to ensure that your classes are designed in a way that maximizes encapsulation and minimizes coupling.
Which of the following statements is true about Java classes?
A) A class should have only a single responsibility and should not be responsible for multiple tasks or functions.
B) A class should expose its internal state as public members to promote ease of use and flexibility.
C) A class should directly manipulate the state of other classes to minimize dependencies and increase modularity.
D) A class should expose its private methods and properties to subclasses to promote code reuse.
Note: You can assume that the system you are designing is complex and includes multiple classes that interact with each other.
Statistics For Business And Economics
ISBN: 9780321826237
12th Edition
Authors: James T. McClave, P. George Benson, Terry T Sincich