posted 17 years ago
Please check the JavaRanch naming policy, which requires a "last name" longer than "k".
Coupling means that the "internals" of one class are bound to the workings of another. If you have a public field "f" in class Foo and an object myFoo, then an object of another class can say
... = myFoo.f;
or
myFoo.f = ...
That represents tight coupling. It means the fields of the class become part of its public interface; you can't change the fields without "breaking" the code of another class.
If you make that field private, then it can only be accessed via get or set methods or other methods, and that reduces coupling. You can also put controls in these methods to restrict access even more.
Coupling is usually (as Sellars and Yeatman would have said) a Bad Thing.
Cohesion is generally a Good Thing.
It means that a class does one thing and does it well and it doesn't try to do something else. It means that a class keeps its private details hidden (data hiding and encapsulation) and other classes don't need to know how they work. It means there is no access to the internals of the class, only "results" in the form of return values from methods.
Or it means something rather like that.