 When a program invokes a library, it gains the behavior implemented inside that library without having to implement that behavior itself.Libraries encourage the sharing of code in a modular fashion, and ease the distribution of the code.The behavior implemented by a library can be connected to the invoking program at different program lifecycle phases.