Coupling - rahul00773/JavaConcepts GitHub Wiki

The degree of dependency between the components is called coupling.

If dependency is more than it is considered as tightly coupling. And if dependency is less then it is considered as loosely coupling.

Class A{

Static int I =B.j; }

Class B{

Static int j = C.k; }

Class C{

Static int k = D.m1(); }

Class D{

Public static int m1(){

Return 10;

}

}

The above components are said to be tightly couple with each other. Because dependency between the components is more.

Tightly coupling is not a good programming practice. Because it has several serious disadvantages.

1. Without effecting remaining components we can not modify any component and hence enhancement will become difficult.
3. It separates resusibility.
4. It reduces maintainability of the application. 
5. And hence we have to maintain dependency between the components as less as possible. That is loosely coupling is a good programming practice