Multiple choice technology web technology

Given: ClassA has a ClassD Methods in ClassA use public methods in ClassB Methods in ClassC use public methods in ClassA Methods in ClassA use public variables in ClassB Which is most likely true? (Choose the most likely.)

  1. ClassD has low cohesion

  2. ClassA has weak encapsulation

  3. ClassB has weak encapsulation

  4. ClassB has strong encapsulation

  5. ClassC is tightly coupled to ClassA

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Encapsulation is the practice of hiding a class's internal data and requiring all interaction to go through public methods. When ClassA uses public variables in ClassB instead of accessor methods, ClassB exposes its internal implementation details, representing weak encapsulation.