Difference between association and dependency?

Association –> has-a C object (as a member variable)

Dependency –> references B (as a method parameter or return type)


Dependency – A change in a class affects the change in it’s dependent class. Example- Circle is dependent on Shape (an interface). If you change Shape , it affects Circle too. So, Circle has a dependency on Shape.

Association– means there is a certain relationship between 2 objects

(one-one, one-many,many-many)