consider this example:-
class A{
...
}
class B extends A{
....
}
the above code shows IS A relationship, this can be implemented as Inheritance.
Class Library{
Book b=new Book();
CD cc=new CD();
}
this shows HAS A relationship.
HAS A also know as composition.