IOC: Inversion of control is used when you are not worried about the actual creation of objects. You will assume that the object will be created and it will be supplied to the executor while execution. Inversion of Control is a principle in software engineering by which the control of objects or portions of a program is transferred to a container or framework. It’s most often used in the context of object-oriented programming. IOC can be implemented using service locators, events, delegates or dependency injection. Dependency Injection is a form of IOC. Dependency injection can be achieved via constructor injection, property injection or even a method injection. DI provides a way to inject objects into other objects.  For example, public class Customer{
public Logger log;
public Customer(Logger obj){      // this is constructor injection
log = obj;
}
}