Can you please explain why it is tightly coupled and not loosely coupled? I'm not sure in questions about coupling and cohesion. I think loose coupling means that class Two doesn't know the implementation details about class One and uses it's API(interface), so I would say that b is correct - where am I wrong?
Thanks for answering [ August 29, 2008: Message edited by: Rasto Slivensky ]
Classes are tightly coupled if they depend on the internal implementation of each other. But I don't think that acessor and mutator methods are considered internal implementations. My only concern is still that getX is not public....
These two classes are loosly coupled and not tightly. So option B is correct. In tightly coupled methods if change code in class A then it do not affect class B so they not tighly coupled. Both implementation do not affect each other. and class B is using class A so there is loose coupling. I hope this thread is now clear.