inheritance and delegation are both ways to add some functionality to a class.
The major difference is that your class is more tightly coupled to a base class if you use inheritance. Then your extending class belongs to the class hierarchy forever. This can be good or not so good depending on the situation.
Delegation means that your class is just using the functionality of one or more other classes to provide this functionality for its client classes. Therefore it delegates all work that isn't directly part of your class to other classes. The big advantage is that you can exchange the classes you are delegating to at runtime for example to provide different implementations of the delegation classes.