Java OCA OCP Practice Question 1322

Question

Suppose class Car has public variables doB and doA, and a public method doC().

Class Driver manipulates an instance of Car by changing the variables and then calling the method.

Which statements are true?

Choose all that apply.

  • A. The Car and Driver classes are loosely coupled.
  • B. The Car and Driver classes are tightly coupled.
  • C. This degree of coupling is desirable.
  • D. This degree of coupling is undesirable.


B, D.

Note

Tightness of coupling expresses the degree to which one class relies on knowledge of the internals of another class.

Tight coupling is undesirable because if class Car changes the way it stores its data, class Driver (and any other similarly coupled classes) needs to be rewritten.




PreviousNext

Related